Skip to content

Commit da5b73d

Browse files
committed
Squashed 'json/' changes from 33791274..8e2a05a9
8e2a05a9 Revert "HTTP -> HTTPS for specification URIs." f0594353 Merge pull request #327 from json-schema-org/ref-scoping 26933221 fixed test structure; had a think about the logic. 2d0ce046 added test to illustrate $ref defining a new scope git-subtree-dir: json git-subtree-split: 8e2a05a99cd49b38e05bb40cf10b5e70a3c61cbe
1 parent b24968d commit da5b73d

9 files changed

Lines changed: 36 additions & 11 deletions

File tree

test-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://json-schema.org/draft-04/schema#",
2+
"$schema": "http://json-schema.org/draft-04/schema#",
33
"definitions": {
44
"outputItem": {
55
"type": "object",

tests/draft2019-09/ref.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,5 +357,30 @@
357357
"valid": false
358358
}
359359
]
360+
},
361+
{
362+
"description": "ref creates new scope when adjacent to keywords",
363+
"schema": {
364+
"$defs": {
365+
"A": {
366+
"unevaluatedProperties": false
367+
}
368+
},
369+
"properties": {
370+
"prop1": {
371+
"type": "string"
372+
}
373+
},
374+
"$ref": "#/$defs/A"
375+
},
376+
"tests": [
377+
{
378+
"description": "referenced subschema doesn't see annoations from properties",
379+
"data": {
380+
"prop1": "match"
381+
},
382+
"valid": false
383+
}
384+
]
360385
}
361386
]

tests/draft3/ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
},
176176
{
177177
"description": "remote ref, containing refs itself",
178-
"schema": {"$ref": "https://json-schema.org/draft-03/schema#"},
178+
"schema": {"$ref": "http://json-schema.org/draft-03/schema#"},
179179
"tests": [
180180
{
181181
"description": "remote ref valid",

tests/draft4/definitions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"description": "valid definition",
4-
"schema": {"$ref": "https://json-schema.org/draft-04/schema#"},
4+
"schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
55
"tests": [
66
{
77
"description": "valid definition schema",
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"description": "invalid definition",
19-
"schema": {"$ref": "https://json-schema.org/draft-04/schema#"},
19+
"schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
2020
"tests": [
2121
{
2222
"description": "invalid definition schema",

tests/draft4/ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
},
176176
{
177177
"description": "remote ref, containing refs itself",
178-
"schema": {"$ref": "https://json-schema.org/draft-04/schema#"},
178+
"schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
179179
"tests": [
180180
{
181181
"description": "remote ref valid",

tests/draft6/definitions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"description": "valid definition",
4-
"schema": {"$ref": "https://json-schema.org/draft-06/schema#"},
4+
"schema": {"$ref": "http://json-schema.org/draft-06/schema#"},
55
"tests": [
66
{
77
"description": "valid definition schema",
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"description": "invalid definition",
19-
"schema": {"$ref": "https://json-schema.org/draft-06/schema#"},
19+
"schema": {"$ref": "http://json-schema.org/draft-06/schema#"},
2020
"tests": [
2121
{
2222
"description": "invalid definition schema",

tests/draft6/ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
},
176176
{
177177
"description": "remote ref, containing refs itself",
178-
"schema": {"$ref": "https://json-schema.org/draft-06/schema#"},
178+
"schema": {"$ref": "http://json-schema.org/draft-06/schema#"},
179179
"tests": [
180180
{
181181
"description": "remote ref valid",

tests/draft7/definitions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"description": "valid definition",
4-
"schema": {"$ref": "https://json-schema.org/draft-07/schema#"},
4+
"schema": {"$ref": "http://json-schema.org/draft-07/schema#"},
55
"tests": [
66
{
77
"description": "valid definition schema",
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"description": "invalid definition",
19-
"schema": {"$ref": "https://json-schema.org/draft-07/schema#"},
19+
"schema": {"$ref": "http://json-schema.org/draft-07/schema#"},
2020
"tests": [
2121
{
2222
"description": "invalid definition schema",

tests/draft7/ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
},
176176
{
177177
"description": "remote ref, containing refs itself",
178-
"schema": {"$ref": "https://json-schema.org/draft-07/schema#"},
178+
"schema": {"$ref": "http://json-schema.org/draft-07/schema#"},
179179
"tests": [
180180
{
181181
"description": "remote ref valid",

0 commit comments

Comments
 (0)