File tree 9 files changed +125
-27
lines changed 9 files changed +125
-27
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ This suite is being used by:
68
68
69
69
* [ json_schema] ( https://github.com/patefacio/json_schema )
70
70
71
+ ### Elixir ###
72
+
73
+ * [ ex_json_schema] ( https://github.com/jonasschmidt/ex_json_schema )
74
+
71
75
### Erlang ###
72
76
73
77
* [ jesse] ( https://github.com/klarna/jesse )
@@ -114,10 +118,12 @@ for more information.
114
118
### .NET ###
115
119
116
120
* [ Newtonsoft.Json.Schema] ( https://github.com/JamesNK/Newtonsoft.Json.Schema )
121
+ * [ Manatee.Json] ( https://github.com/gregsdennis/Manatee.Json )
117
122
118
123
### PHP ###
119
124
120
125
* [ json-schema] ( https://github.com/justinrainbow/json-schema )
126
+ * [ json-guard] ( https://github.com/thephpleague/json-guard )
121
127
122
128
### Python ###
123
129
@@ -135,6 +141,14 @@ for more information.
135
141
136
142
* [ JSONSchema] ( https://github.com/kylef/JSONSchema.swift )
137
143
144
+ ### Clojure ###
145
+
146
+ * [ json-schema] ( https://github.com/tatut/json-schema )
147
+
148
+ ### PostgreSQL ###
149
+
150
+ * [ postgres-json-schema] ( https://github.com/gavinwahl/postgres-json-schema )
151
+
138
152
If you use it as well, please fork and send a pull request adding yourself to
139
153
the list :).
140
154
Original file line number Diff line number Diff line change @@ -52,33 +52,8 @@ REMOTES = {
52
52
}
53
53
REMOTES_DIR = os .path .join (ROOT_DIR , "remotes" )
54
54
55
- TESTSUITE_SCHEMA = {
56
- "$schema" : "http://json-schema.org/draft-03/schema#" ,
57
- "type" : "array" ,
58
- "items" : {
59
- "type" : "object" ,
60
- "properties" : {
61
- "description" : {"type" : "string" , "required" : True },
62
- "schema" : {"required" : True },
63
- "tests" : {
64
- "type" : "array" ,
65
- "items" : {
66
- "type" : "object" ,
67
- "properties" : {
68
- "description" : {"type" : "string" , "required" : True },
69
- "data" : {"required" : True },
70
- "valid" : {"type" : "boolean" , "required" : True }
71
- },
72
- "additionalProperties" : False
73
- },
74
- "minItems" : 1
75
- }
76
- },
77
- "additionalProperties" : False ,
78
- "minItems" : 1
79
- }
80
- }
81
-
55
+ with open (os .path .join (ROOT_DIR , "test-schema.json" )) as schema :
56
+ TESTSUITE_SCHEMA = json .load (schema )
82
57
83
58
def files (paths ):
84
59
for path in paths :
Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " http://json-schema.org/draft-03/schema#" ,
3
+ "type" : " array" ,
4
+ "items" : {
5
+ "type" : " object" ,
6
+ "properties" : {
7
+ "description" : {"type" : " string" , "required" : true },
8
+ "schema" : {"required" : true },
9
+ "tests" : {
10
+ "type" : " array" ,
11
+ "items" : {
12
+ "type" : " object" ,
13
+ "properties" : {
14
+ "description" : {"type" : " string" , "required" : true },
15
+ "data" : {"required" : true },
16
+ "valid" : {"type" : " boolean" , "required" : true }
17
+ },
18
+ "additionalProperties" : false
19
+ },
20
+ "minItems" : 1
21
+ }
22
+ },
23
+ "additionalProperties" : false ,
24
+ "minItems" : 1
25
+ }
26
+ }
Original file line number Diff line number Diff line change 18
18
"data" : " foo" ,
19
19
"valid" : false
20
20
},
21
+ {
22
+ "description" : " a string is still not an integer, even if it looks like one" ,
23
+ "data" : " 1" ,
24
+ "valid" : false
25
+ },
21
26
{
22
27
"description" : " an object is not an integer" ,
23
28
"data" : {},
59
64
"data" : " foo" ,
60
65
"valid" : false
61
66
},
67
+ {
68
+ "description" : " a string is still not a number, even if it looks like one" ,
69
+ "data" : " 1" ,
70
+ "valid" : false
71
+ },
62
72
{
63
73
"description" : " an object is not a number" ,
64
74
"data" : {},
100
110
"data" : " foo" ,
101
111
"valid" : true
102
112
},
113
+ {
114
+ "description" : " a string is still a string, even if it looks like a number" ,
115
+ "data" : " 1" ,
116
+ "valid" : true
117
+ },
103
118
{
104
119
"description" : " an object is not a string" ,
105
120
"data" : {},
Original file line number Diff line number Diff line change 40
40
"description" : " wrong types" ,
41
41
"data" : [ " foo" , 1 ],
42
42
"valid" : false
43
+ },
44
+ {
45
+ "description" : " incomplete array of items" ,
46
+ "data" : [ 1 ],
47
+ "valid" : true
48
+ },
49
+ {
50
+ "description" : " array with additional items" ,
51
+ "data" : [ 1 , " foo" , true ],
52
+ "valid" : true
53
+ },
54
+ {
55
+ "description" : " empty array" ,
56
+ "data" : [ ],
57
+ "valid" : true
43
58
}
44
59
]
45
60
}
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "description" : " ECMA 262 regex non-compliance" ,
4
+ "schema" : { "format" : " regex" },
5
+ "tests" : [
6
+ {
7
+ "description" : " ECMA 262 has no support for \\ Z anchor from .NET" ,
8
+ "data" : " ^\\ S(|(.|\\ n)*\\ S)\\ Z" ,
9
+ "valid" : false
10
+ }
11
+ ]
12
+ }
13
+ ]
Original file line number Diff line number Diff line change 188
188
"valid" : false
189
189
}
190
190
]
191
+ },
192
+ {
193
+ "description" : " property named $ref that is not a reference" ,
194
+ "schema" : {
195
+ "properties" : {
196
+ "$ref" : {"type" : " string" }
197
+ }
198
+ },
199
+ "tests" : [
200
+ {
201
+ "description" : " property named $ref valid" ,
202
+ "data" : {"$ref" : " a" },
203
+ "valid" : true
204
+ },
205
+ {
206
+ "description" : " property named $ref invalid" ,
207
+ "data" : {"$ref" : 2 },
208
+ "valid" : false
209
+ }
210
+ ]
191
211
}
192
212
]
Original file line number Diff line number Diff line change 18
18
"description" : " non-present required property is invalid" ,
19
19
"data" : {"bar" : 1 },
20
20
"valid" : false
21
+ },
22
+ {
23
+ "description" : " ignores non-objects" ,
24
+ "data" : 12 ,
25
+ "valid" : true
21
26
}
22
27
]
23
28
},
Original file line number Diff line number Diff line change 18
18
"data" : " foo" ,
19
19
"valid" : false
20
20
},
21
+ {
22
+ "description" : " a string is still not an integer, even if it looks like one" ,
23
+ "data" : " 1" ,
24
+ "valid" : false
25
+ },
21
26
{
22
27
"description" : " an object is not an integer" ,
23
28
"data" : {},
59
64
"data" : " foo" ,
60
65
"valid" : false
61
66
},
67
+ {
68
+ "description" : " a string is still not a number, even if it looks like one" ,
69
+ "data" : " 1" ,
70
+ "valid" : false
71
+ },
62
72
{
63
73
"description" : " an object is not a number" ,
64
74
"data" : {},
100
110
"data" : " foo" ,
101
111
"valid" : true
102
112
},
113
+ {
114
+ "description" : " a string is still a string, even if it looks like a number" ,
115
+ "data" : " 1" ,
116
+ "valid" : true
117
+ },
103
118
{
104
119
"description" : " an object is not a string" ,
105
120
"data" : {},
You can’t perform that action at this time.
0 commit comments