Skip to content

Commit 366f15b

Browse files
committed
added initial set of tests (with expected output) for draft/2019-04
1 parent 147da3d commit 366f15b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+33195
-0
lines changed

tests/draft2019-04/additionalItems.json

Lines changed: 533 additions & 0 deletions
Large diffs are not rendered by default.

tests/draft2019-04/additionalProperties.json

Lines changed: 827 additions & 0 deletions
Large diffs are not rendered by default.

tests/draft2019-04/allOf.json

Lines changed: 1663 additions & 0 deletions
Large diffs are not rendered by default.

tests/draft2019-04/anyOf.json

Lines changed: 1235 additions & 0 deletions
Large diffs are not rendered by default.

tests/draft2019-04/boolean_schema.json

Lines changed: 437 additions & 0 deletions
Large diffs are not rendered by default.

tests/draft2019-04/const.json

Lines changed: 421 additions & 0 deletions
Large diffs are not rendered by default.

tests/draft2019-04/contains.json

Lines changed: 914 additions & 0 deletions
Large diffs are not rendered by default.

tests/draft2019-04/default.json

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
[
2+
{
3+
"description": "invalid type for default",
4+
"schema": {"properties": {"foo": {"type": "integer", "default": []}}},
5+
"tests": [
6+
{
7+
"description": "valid when property is specified",
8+
"data": {"foo": 13},
9+
"valid": true,
10+
"output": {
11+
"basic": {
12+
"valid": true,
13+
"keywordLocation": "#",
14+
"instanceLocation": "#"
15+
},
16+
"detailed": {
17+
"valid": true,
18+
"keywordLocation": "#",
19+
"instanceLocation": "#"
20+
},
21+
"verbose": {
22+
"valid": true,
23+
"keywordLocation": "#",
24+
"instanceLocation": "#",
25+
"annotations": [
26+
{
27+
"valid": true,
28+
"keywordLocation": "#/properties",
29+
"instanceLocation": "#",
30+
"keyword": "properties",
31+
"annotations": [
32+
{
33+
"valid": true,
34+
"keywordLocation": "#/properties/foo",
35+
"instanceLocation": "#/foo",
36+
"annotations": [
37+
{
38+
"valid": true,
39+
"keywordLocation": "#/properties/foo/type",
40+
"instanceLocation": "#/foo",
41+
"keyword": "type"
42+
},
43+
{
44+
"valid": true,
45+
"keywordLocation": "#/properties/foo/default",
46+
"instanceLocation": "#/foo",
47+
"keyword": "default"
48+
}
49+
]
50+
}
51+
]
52+
}
53+
]
54+
}
55+
}
56+
},
57+
{
58+
"description": "still valid when the invalid default is used",
59+
"data": {},
60+
"valid": true,
61+
"output": {
62+
"basic": {
63+
"valid": true,
64+
"keywordLocation": "#",
65+
"instanceLocation": "#"
66+
},
67+
"detailed": {
68+
"valid": true,
69+
"keywordLocation": "#",
70+
"instanceLocation": "#"
71+
},
72+
"verbose": {
73+
"valid": true,
74+
"keywordLocation": "#",
75+
"instanceLocation": "#",
76+
"annotations": [
77+
{
78+
"valid": true,
79+
"keywordLocation": "#/properties",
80+
"instanceLocation": "#",
81+
"keyword": "properties"
82+
}
83+
]
84+
}
85+
}
86+
}
87+
]
88+
},
89+
{
90+
"description": "invalid string value for default",
91+
"schema": {
92+
"properties": {
93+
"bar": {"type": "string", "minLength": 4, "default": "bad"}
94+
}
95+
},
96+
"tests": [
97+
{
98+
"description": "valid when property is specified",
99+
"data": {"bar": "good"},
100+
"valid": true,
101+
"output": {
102+
"basic": {
103+
"valid": true,
104+
"keywordLocation": "#/properties/bar/default",
105+
"instanceLocation": "#/bar",
106+
"keyword": "default",
107+
"annotation": "bad"
108+
},
109+
"detailed": {
110+
"valid": true,
111+
"keywordLocation": "#/properties/bar/default",
112+
"instanceLocation": "#/bar",
113+
"keyword": "default",
114+
"annotation": "bad"
115+
},
116+
"verbose": {
117+
"valid": true,
118+
"keywordLocation": "#",
119+
"instanceLocation": "#",
120+
"annotations": [
121+
{
122+
"valid": true,
123+
"keywordLocation": "#/properties",
124+
"instanceLocation": "#",
125+
"keyword": "properties",
126+
"annotations": [
127+
{
128+
"valid": true,
129+
"keywordLocation": "#/properties/bar",
130+
"instanceLocation": "#/bar",
131+
"annotations": [
132+
{
133+
"valid": true,
134+
"keywordLocation": "#/properties/bar/type",
135+
"instanceLocation": "#/bar",
136+
"keyword": "type"
137+
},
138+
{
139+
"valid": true,
140+
"keywordLocation": "#/properties/bar/minLength",
141+
"instanceLocation": "#/bar",
142+
"keyword": "minLength"
143+
},
144+
{
145+
"valid": true,
146+
"keywordLocation": "#/properties/bar/default",
147+
"instanceLocation": "#/bar",
148+
"keyword": "default",
149+
"annotation": "bad"
150+
}
151+
]
152+
}
153+
]
154+
}
155+
]
156+
}
157+
}
158+
},
159+
{
160+
"description": "still valid when the invalid default is used",
161+
"data": {},
162+
"valid": true,
163+
"output": {
164+
"basic": {
165+
"valid": true,
166+
"keywordLocation": "#",
167+
"instanceLocation": "#"
168+
},
169+
"detailed": {
170+
"valid": true,
171+
"keywordLocation": "#",
172+
"instanceLocation": "#"
173+
},
174+
"verbose": {
175+
"valid": true,
176+
"keywordLocation": "#",
177+
"instanceLocation": "#",
178+
"annotations": [
179+
{
180+
"valid": true,
181+
"keywordLocation": "#/properties",
182+
"instanceLocation": "#",
183+
"keyword": "properties"
184+
}
185+
]
186+
}
187+
}
188+
}
189+
]
190+
}
191+
]

0 commit comments

Comments
 (0)