Skip to content

Commit 349c5a8

Browse files
Merge pull request #692 from json-schema-org/ether/fix-subSchemas-refs
fix subschema locations and their $refs
2 parents 451baca + 6d7a44b commit 349c5a8

File tree

8 files changed

+36
-28
lines changed

8 files changed

+36
-28
lines changed

remotes/draft-next/subSchemas.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"$schema": "https://json-schema.org/draft/next/schema",
3-
"integer": {
4-
"type": "integer"
5-
},
6-
"refToInteger": {
7-
"$ref": "#/integer"
3+
"$defs": {
4+
"integer": {
5+
"type": "integer"
6+
},
7+
"refToInteger": {
8+
"$ref": "#/$defs/integer"
9+
}
810
}
911
}

remotes/draft2019-09/subSchemas.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"$schema": "https://json-schema.org/draft/2019-09/schema",
3-
"integer": {
4-
"type": "integer"
5-
},
6-
"refToInteger": {
7-
"$ref": "#/integer"
3+
"$defs": {
4+
"integer": {
5+
"type": "integer"
6+
},
7+
"refToInteger": {
8+
"$ref": "#/$defs/integer"
9+
}
810
}
911
}

remotes/draft2020-12/subSchemas.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"integer": {
4-
"type": "integer"
5-
},
6-
"refToInteger": {
7-
"$ref": "#/integer"
3+
"$defs": {
4+
"integer": {
5+
"type": "integer"
6+
},
7+
"refToInteger": {
8+
"$ref": "#/$defs/integer"
9+
}
810
}
911
}

remotes/subSchemas.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
2-
"integer": {
3-
"type": "integer"
4-
},
5-
"refToInteger": {
6-
"$ref": "#/integer"
2+
"definitions": {
3+
"integer": {
4+
"type": "integer"
5+
},
6+
"refToInteger": {
7+
"$ref": "#/definitions/integer"
8+
}
79
}
810
}

tests/draft3/refRemote.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
{
1919
"description": "fragment within remote ref",
20-
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
20+
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/definitions/integer"},
2121
"tests": [
2222
{
2323
"description": "remote fragment valid",
@@ -34,7 +34,7 @@
3434
{
3535
"description": "ref within remote ref",
3636
"schema": {
37-
"$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
37+
"$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger"
3838
},
3939
"tests": [
4040
{

tests/draft4/refRemote.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
{
1919
"description": "fragment within remote ref",
20-
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
20+
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/definitions/integer"},
2121
"tests": [
2222
{
2323
"description": "remote fragment valid",
@@ -34,7 +34,7 @@
3434
{
3535
"description": "ref within remote ref",
3636
"schema": {
37-
"$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
37+
"$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger"
3838
},
3939
"tests": [
4040
{

tests/draft6/refRemote.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
{
1919
"description": "fragment within remote ref",
20-
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
20+
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/definitions/integer"},
2121
"tests": [
2222
{
2323
"description": "remote fragment valid",
@@ -34,7 +34,7 @@
3434
{
3535
"description": "ref within remote ref",
3636
"schema": {
37-
"$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
37+
"$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger"
3838
},
3939
"tests": [
4040
{

tests/draft7/refRemote.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
{
1919
"description": "fragment within remote ref",
20-
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
20+
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/definitions/integer"},
2121
"tests": [
2222
{
2323
"description": "remote fragment valid",
@@ -34,7 +34,7 @@
3434
{
3535
"description": "ref within remote ref",
3636
"schema": {
37-
"$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
37+
"$ref": "http://localhost:1234/subSchemas.json#/definitions/refToInteger"
3838
},
3939
"tests": [
4040
{

0 commit comments

Comments
 (0)