Skip to content

Commit 756a2e1

Browse files
committed
self-reference test case
1 parent eca3551 commit 756a2e1

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

tests/resources/suite/ref.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[
22
{
3+
"description": "remote ref",
34
"schema": {
45
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
56
},
@@ -15,5 +16,63 @@
1516
"valid": false
1617
}
1718
]
19+
},
20+
{
21+
"description": "enum-terminated self-reference",
22+
"schema": {
23+
"anyOf": [
24+
{
25+
"$ref": "#/definitions/Foo"
26+
}
27+
],
28+
"definitions": {
29+
"Foo": {
30+
"oneOf": [
31+
{
32+
"enum": [
33+
"A",
34+
"B"
35+
]
36+
},
37+
{
38+
"type": "object",
39+
"additionalProperties": {
40+
"$ref": "#/definitions/Foo"
41+
}
42+
}
43+
]
44+
}
45+
}
46+
},
47+
"tests": [
48+
{
49+
"description": "valid against enum",
50+
"data": {
51+
"test": "A",
52+
"test1": "B",
53+
"test2": {
54+
"test4": "A",
55+
"test5": {
56+
"test6": "B"
57+
}
58+
}
59+
},
60+
"valid": true
61+
},
62+
{
63+
"description": "invalid against enum",
64+
"data": {
65+
"test": "A",
66+
"test1": "B",
67+
"test2": {
68+
"test4": "A",
69+
"test5": {
70+
"test6": "C"
71+
}
72+
}
73+
},
74+
"valid": false
75+
}
76+
]
1877
}
1978
]

0 commit comments

Comments
 (0)