Skip to content

Commit 9c88a0b

Browse files
authored
Merge pull request #697 from json-schema-org/gregsdennis/add-ref-into-known-nonapplicator
add optional tests for `$ref`ing into known non-applicator keywords
2 parents cda4281 + fea2cf1 commit 9c88a0b

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

tests/draft-next/optional/refOfUnknownKeyword.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,28 @@
4242
"valid": false
4343
}
4444
]
45+
},
46+
{
47+
"description": "reference internals of known non-applicator",
48+
"schema": {
49+
"$schema": "https://json-schema.org/draft/next/schema",
50+
"$id": "/base",
51+
"examples": [
52+
{ "type": "string" }
53+
],
54+
"$ref": "#/examples/0"
55+
},
56+
"tests": [
57+
{
58+
"description": "match",
59+
"data": "a string",
60+
"valid": true
61+
},
62+
{
63+
"description": "mismatch",
64+
"data": 42,
65+
"valid": false
66+
}
67+
]
4568
}
4669
]

tests/draft2019-09/optional/refOfUnknownKeyword.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,28 @@
4242
"valid": false
4343
}
4444
]
45+
},
46+
{
47+
"description": "reference internals of known non-applicator",
48+
"schema": {
49+
"$schema": "https://json-schema.org/draft/2019-09/schema",
50+
"$id": "/base",
51+
"examples": [
52+
{ "type": "string" }
53+
],
54+
"$ref": "#/examples/0"
55+
},
56+
"tests": [
57+
{
58+
"description": "match",
59+
"data": "a string",
60+
"valid": true
61+
},
62+
{
63+
"description": "mismatch",
64+
"data": 42,
65+
"valid": false
66+
}
67+
]
4568
}
4669
]

tests/draft2020-12/optional/refOfUnknownKeyword.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,28 @@
4242
"valid": false
4343
}
4444
]
45+
},
46+
{
47+
"description": "reference internals of known non-applicator",
48+
"schema": {
49+
"$schema": "https://json-schema.org/draft/2020-12/schema",
50+
"$id": "/base",
51+
"examples": [
52+
{ "type": "string" }
53+
],
54+
"$ref": "#/examples/0"
55+
},
56+
"tests": [
57+
{
58+
"description": "match",
59+
"data": "a string",
60+
"valid": true
61+
},
62+
{
63+
"description": "mismatch",
64+
"data": 42,
65+
"valid": false
66+
}
67+
]
4568
}
4669
]

0 commit comments

Comments
 (0)