Skip to content

Commit 32db5cd

Browse files
committed
update json schema fixtures
1 parent 84511ac commit 32db5cd

15 files changed

+224
-15
lines changed

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 2
10+
trim_trailing_whitespace = true
11+
12+
# Set default charset
13+
[*.{js,py,go,scala,rb,java,html,css,less,sass,md}]
14+
charset = utf-8
15+
16+
# Tab indentation (no size specified)
17+
[*.go]
18+
indent_style = tab
19+
20+
[*.md]
21+
trim_trailing_whitespace = false
22+
23+
# Matches the exact files either package.json or .travis.yml
24+
[{package.json,.travis.yml}]
25+
indent_style = space
26+
indent_size = 2

fixtures/jsonschema_suite/additionalItems.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@
4040
},
4141
"tests": [
4242
{
43-
"description": "no additional items present",
43+
"description": "fewer number of items present",
44+
"data": [ 1, 2 ],
45+
"valid": true
46+
},
47+
{
48+
"description": "equal number of items present",
4449
"data": [ 1, 2, 3 ],
4550
"valid": true
4651
},

fixtures/jsonschema_suite/additionalProperties.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,20 @@
1919
"valid": false
2020
},
2121
{
22-
"description": "ignores non-objects",
22+
"description": "ignores arrays",
2323
"data": [1, 2, 3],
2424
"valid": true
2525
},
26+
{
27+
"description": "ignores strings",
28+
"data": "foobarbaz",
29+
"valid": true
30+
},
31+
{
32+
"description": "ignores other non-objects",
33+
"data": 12,
34+
"valid": true
35+
},
2636
{
2737
"description": "patternProperties are not additional properties",
2838
"data": {"foo":1, "vroom": 2},

fixtures/jsonschema_suite/dependencies.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,18 @@
2626
"valid": false
2727
},
2828
{
29-
"description": "ignores non-objects",
30-
"data": "foo",
29+
"description": "ignores arrays",
30+
"data": ["bar"],
31+
"valid": true
32+
},
33+
{
34+
"description": "ignores strings",
35+
"data": "foobar",
36+
"valid": true
37+
},
38+
{
39+
"description": "ignores other non-objects",
40+
"data": 12,
3141
"valid": true
3242
}
3343
]

fixtures/jsonschema_suite/items.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
"description": "ignores non-arrays",
2020
"data": {"foo" : "bar"},
2121
"valid": true
22+
},
23+
{
24+
"description": "JavaScript pseudo-array is valid",
25+
"data": {
26+
"0": "invalid",
27+
"length": 1
28+
},
29+
"valid": true
2230
}
2331
]
2432
},
@@ -55,6 +63,15 @@
5563
"description": "empty array",
5664
"data": [ ],
5765
"valid": true
66+
},
67+
{
68+
"description": "JavaScript pseudo-array is valid",
69+
"data": {
70+
"0": "invalid",
71+
"1": "valid",
72+
"length": 2
73+
},
74+
"valid": true
5875
}
5976
]
6077
}

fixtures/jsonschema_suite/maxProperties.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@
1919
"valid": false
2020
},
2121
{
22-
"description": "ignores non-objects",
22+
"description": "ignores arrays",
23+
"data": [1, 2, 3],
24+
"valid": true
25+
},
26+
{
27+
"description": "ignores strings",
2328
"data": "foobar",
2429
"valid": true
30+
},
31+
{
32+
"description": "ignores other non-objects",
33+
"data": 12,
34+
"valid": true
2535
}
2636
]
2737
}

fixtures/jsonschema_suite/maximum.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"data": 2.6,
99
"valid": true
1010
},
11+
{
12+
"description": "boundary point is valid",
13+
"data": 3.0,
14+
"valid": true
15+
},
1116
{
1217
"description": "above the maximum is invalid",
1318
"data": 3.5,

fixtures/jsonschema_suite/minProperties.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@
1919
"valid": false
2020
},
2121
{
22-
"description": "ignores non-objects",
22+
"description": "ignores arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "ignores strings",
2328
"data": "",
2429
"valid": true
30+
},
31+
{
32+
"description": "ignores other non-objects",
33+
"data": 12,
34+
"valid": true
2535
}
2636
]
2737
}

fixtures/jsonschema_suite/minimum.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"data": 2.6,
99
"valid": true
1010
},
11+
{
12+
"description": "boundary point is valid",
13+
"data": 1.1,
14+
"valid": true
15+
},
1116
{
1217
"description": "below the minimum is invalid",
1318
"data": 0.6,

fixtures/jsonschema_suite/optional/format.json

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,80 @@
2525
"schema": {"format": "uri"},
2626
"tests": [
2727
{
28-
"description": "a valid URI",
28+
"description": "a valid URL with anchor tag",
2929
"data": "http://foo.bar/?baz=qux#quux",
3030
"valid": true
3131
},
3232
{
33-
"description": "a valid protocol-relative URI",
34-
"data": "//foo.bar/?baz=qux#quux",
33+
"description": "a valid URL with anchor tag and parantheses",
34+
"data": "http://foo.com/blah_(wikipedia)_blah#cite-1",
35+
"valid": true
36+
},
37+
{
38+
"description": "a valid URL with URL-encoded stuff",
39+
"data": "http://foo.bar/?q=Test%20URL-encoded%20stuff",
40+
"valid": true
41+
},
42+
{
43+
"description": "a valid puny-coded URL ",
44+
"data": "http://xn--nw2a.xn--j6w193g/",
45+
"valid": true
46+
},
47+
{
48+
"description": "a valid URL with many special characters",
49+
"data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com",
50+
"valid": true
51+
},
52+
{
53+
"description": "a valid URL based on IPv4",
54+
"data": "http://223.255.255.254",
55+
"valid": true
56+
},
57+
{
58+
"description": "a valid URL with ftp scheme",
59+
"data": "ftp://ftp.is.co.za/rfc/rfc1808.txt",
60+
"valid": true
61+
},
62+
{
63+
"description": "a valid URL for a simple text file",
64+
"data": "http://www.ietf.org/rfc/rfc2396.txt",
65+
"valid": true
66+
},
67+
{
68+
"description": "a valid URL ",
69+
"data": "ldap://[2001:db8::7]/c=GB?objectClass?one",
3570
"valid": true
3671
},
72+
{
73+
"description": "a valid mailto URI",
74+
"data": "mailto:[email protected]",
75+
"valid": true
76+
},
77+
{
78+
"description": "a valid newsgroup URI",
79+
"data": "news:comp.infosystems.www.servers.unix",
80+
"valid": true
81+
},
82+
{
83+
"description": "a valid tel URI",
84+
"data": "tel:+1-816-555-1212",
85+
"valid": true
86+
},
87+
{
88+
"description": "a valid URN",
89+
"data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2",
90+
"valid": true
91+
},
92+
{
93+
"description": "an invalid protocol-relative URI Reference",
94+
"data": "//foo.bar/?baz=qux#quux",
95+
"valid": false
96+
},
97+
{
98+
"description": "an invalid relative URI Reference",
99+
"data": "/abc",
100+
"valid": false
101+
},
37102
{
38103
"description": "an invalid URI",
39104
"data": "\\\\WINDOWS\\fileshare",
@@ -43,6 +108,16 @@
43108
"description": "an invalid URI though valid URI reference",
44109
"data": "abc",
45110
"valid": false
111+
},
112+
{
113+
"description": "an invalid URI with spaces",
114+
"data": "http:// shouldfail.com",
115+
"valid": false
116+
},
117+
{
118+
"description": "an invalid URI with spaces and missing scheme",
119+
"data": ":// should fail",
120+
"valid": false
46121
}
47122
]
48123
},

0 commit comments

Comments
 (0)