Skip to content

Commit 45cf1fb

Browse files
committed
Squashed 'json/' changes from 3cef243..9208016
9208016 Merge pull request #67 from iainbeeston/defaults f57888c Added tests around the default property db28fee Merge pull request #63 from iainbeeston/patch-1 609944b Added the json-schema ruby gem to the list of libraries using the test suite git-subtree-dir: json git-subtree-split: 9208016d04c1b6774d5a17e8b037161873414edb
1 parent 4307528 commit 45cf1fb

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ This suite is being used by:
7676
* [json_schema (Dart)](https://github.com/patefacio/json_schema)
7777
* [tv4 (JavaScript)](https://github.com/geraintluff/tv4)
7878
* [Jsonary (JavaScript)](https://github.com/jsonary-js/jsonary)
79+
* [json-schema (Ruby)](https://github.com/hoxworth/json-schema)
7980

8081
If you use it as well, please fork and send a pull request adding yourself to
8182
the list :).

tests/draft3/default.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[
2+
{
3+
"description": "invalid type for default",
4+
"schema": {
5+
"properties": {
6+
"foo": {
7+
"type": "integer",
8+
"default": []
9+
}
10+
}
11+
},
12+
"tests": [
13+
{
14+
"description": "valid when property is specified",
15+
"data": {"foo": 13},
16+
"valid": true
17+
},
18+
{
19+
"description": "still valid when the invalid default is used",
20+
"data": {},
21+
"valid": true
22+
}
23+
]
24+
},
25+
{
26+
"description": "invalid string value for default",
27+
"schema": {
28+
"properties": {
29+
"bar": {
30+
"type": "string",
31+
"minLength": 4,
32+
"default": "bad"
33+
}
34+
}
35+
},
36+
"tests": [
37+
{
38+
"description": "valid when property is specified",
39+
"data": {"bar": "good"},
40+
"valid": true
41+
},
42+
{
43+
"description": "still valid when the invalid default is used",
44+
"data": {},
45+
"valid": true
46+
}
47+
]
48+
}
49+
]

tests/draft4/default.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[
2+
{
3+
"description": "invalid type for default",
4+
"schema": {
5+
"properties": {
6+
"foo": {
7+
"type": "integer",
8+
"default": []
9+
}
10+
}
11+
},
12+
"tests": [
13+
{
14+
"description": "valid when property is specified",
15+
"data": {"foo": 13},
16+
"valid": true
17+
},
18+
{
19+
"description": "still valid when the invalid default is used",
20+
"data": {},
21+
"valid": true
22+
}
23+
]
24+
},
25+
{
26+
"description": "invalid string value for default",
27+
"schema": {
28+
"properties": {
29+
"bar": {
30+
"type": "string",
31+
"minLength": 4,
32+
"default": "bad"
33+
}
34+
}
35+
},
36+
"tests": [
37+
{
38+
"description": "valid when property is specified",
39+
"data": {"bar": "good"},
40+
"valid": true
41+
},
42+
{
43+
"description": "still valid when the invalid default is used",
44+
"data": {},
45+
"valid": true
46+
}
47+
]
48+
}
49+
]

0 commit comments

Comments
 (0)