Skip to content

Commit 86baa12

Browse files
committed
Squashed 'json/' changes from cb2b906..2ca50c0
2ca50c0 The specs say T and Z is case insensitive for date-time. 43dad6a Port forward to draft 6 and 7. 498fd97 Tidy the descriptions a bit. 94ce498 Discard the changes that modify other tests. afa2f40 Merge remote-tracking branch 'origin/pr/137' ff448af Merge pull request #220 from pboettch/master f8bee5b test false-exclusivity for max/min numbers a72e5bf create seperate none-ascii pattern test case for additionalProperties false for draft 3 and 4 d3afa19 test updated with unicode pattern for additionalProperties in both draft git-subtree-dir: json git-subtree-split: 2ca50c0250b28499c9190cf10ce1d582dbee9ceb
1 parent 1079aeb commit 86baa12

File tree

10 files changed

+148
-0
lines changed

10 files changed

+148
-0
lines changed

tests/draft3/additionalProperties.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,25 @@
4040
}
4141
]
4242
},
43+
{
44+
"description": "non-ASCII pattern with additionalProperties",
45+
"schema": {
46+
"patternProperties": {"^á": {}},
47+
"additionalProperties": false
48+
},
49+
"tests": [
50+
{
51+
"description": "matching the pattern is valid",
52+
"data": {"ármányos": 2},
53+
"valid": true
54+
},
55+
{
56+
"description": "not matching the pattern is invalid",
57+
"data": {"élmény": 2},
58+
"valid": false
59+
}
60+
]
61+
},
4362
{
4463
"description":
4564
"additionalProperties allows a schema which should validate",

tests/draft3/optional/format.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
"data": "06/19/1963 08:30:06 PST",
3030
"valid": false
3131
},
32+
{
33+
"description": "case-insensitive T and Z",
34+
"data": "1963-06-19t08:30:06.283185z",
35+
"valid": true
36+
},
3237
{
3338
"description": "only RFC3339 not all of ISO 8601 are valid",
3439
"data": "2013-350T01:01:01",

tests/draft4/additionalProperties.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,25 @@
4040
}
4141
]
4242
},
43+
{
44+
"description": "non-ASCII pattern with additionalProperties",
45+
"schema": {
46+
"patternProperties": {"^á": {}},
47+
"additionalProperties": false
48+
},
49+
"tests": [
50+
{
51+
"description": "matching the pattern is valid",
52+
"data": {"ármányos": 2},
53+
"valid": true
54+
},
55+
{
56+
"description": "not matching the pattern is invalid",
57+
"data": {"élmény": 2},
58+
"valid": false
59+
}
60+
]
61+
},
4362
{
4463
"description":
4564
"additionalProperties allows a schema which should validate",

tests/draft4/maximum.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,32 @@
2525
}
2626
]
2727
},
28+
{
29+
"description": "maximum validation (explicit false exclusivity)",
30+
"schema": {"maximum": 3.0, "exclusiveMaximum": false},
31+
"tests": [
32+
{
33+
"description": "below the maximum is valid",
34+
"data": 2.6,
35+
"valid": true
36+
},
37+
{
38+
"description": "boundary point is valid",
39+
"data": 3.0,
40+
"valid": true
41+
},
42+
{
43+
"description": "above the maximum is invalid",
44+
"data": 3.5,
45+
"valid": false
46+
},
47+
{
48+
"description": "ignores non-numbers",
49+
"data": "x",
50+
"valid": true
51+
}
52+
]
53+
},
2854
{
2955
"description": "exclusiveMaximum validation",
3056
"schema": {

tests/draft4/minimum.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,32 @@
2525
}
2626
]
2727
},
28+
{
29+
"description": "minimum validation (explicit false exclusivity)",
30+
"schema": {"minimum": 1.1, "exclusiveMinimum": false},
31+
"tests": [
32+
{
33+
"description": "above the minimum is valid",
34+
"data": 2.6,
35+
"valid": true
36+
},
37+
{
38+
"description": "boundary point is valid",
39+
"data": 1.1,
40+
"valid": true
41+
},
42+
{
43+
"description": "below the minimum is invalid",
44+
"data": 0.6,
45+
"valid": false
46+
},
47+
{
48+
"description": "ignores non-numbers",
49+
"data": "x",
50+
"valid": true
51+
}
52+
]
53+
},
2854
{
2955
"description": "exclusiveMinimum validation",
3056
"schema": {

tests/draft4/optional/format.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"data": "06/19/1963 08:30:06 PST",
1414
"valid": false
1515
},
16+
{
17+
"description": "case-insensitive T and Z",
18+
"data": "1963-06-19t08:30:06.283185z",
19+
"valid": true
20+
},
1621
{
1722
"description": "only RFC3339 not all of ISO 8601 are valid",
1823
"data": "2013-350T01:01:01",

tests/draft6/additionalProperties.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,25 @@
4040
}
4141
]
4242
},
43+
{
44+
"description": "non-ASCII pattern with additionalProperties",
45+
"schema": {
46+
"patternProperties": {"^á": {}},
47+
"additionalProperties": false
48+
},
49+
"tests": [
50+
{
51+
"description": "matching the pattern is valid",
52+
"data": {"ármányos": 2},
53+
"valid": true
54+
},
55+
{
56+
"description": "not matching the pattern is invalid",
57+
"data": {"élmény": 2},
58+
"valid": false
59+
}
60+
]
61+
},
4362
{
4463
"description":
4564
"additionalProperties allows a schema which should validate",

tests/draft6/optional/format.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"data": "06/19/1963 08:30:06 PST",
1414
"valid": false
1515
},
16+
{
17+
"description": "case-insensitive T and Z",
18+
"data": "1963-06-19t08:30:06.283185z",
19+
"valid": true
20+
},
1621
{
1722
"description": "only RFC3339 not all of ISO 8601 are valid",
1823
"data": "2013-350T01:01:01",

tests/draft7/additionalProperties.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,25 @@
4040
}
4141
]
4242
},
43+
{
44+
"description": "non-ASCII pattern with additionalProperties",
45+
"schema": {
46+
"patternProperties": {"^á": {}},
47+
"additionalProperties": false
48+
},
49+
"tests": [
50+
{
51+
"description": "matching the pattern is valid",
52+
"data": {"ármányos": 2},
53+
"valid": true
54+
},
55+
{
56+
"description": "not matching the pattern is invalid",
57+
"data": {"élmény": 2},
58+
"valid": false
59+
}
60+
]
61+
},
4362
{
4463
"description":
4564
"additionalProperties allows a schema which should validate",

tests/draft7/optional/format/date-time.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"data": "06/19/1963 08:30:06 PST",
1414
"valid": false
1515
},
16+
{
17+
"description": "case-insensitive T and Z",
18+
"data": "1963-06-19t08:30:06.283185z",
19+
"valid": true
20+
},
1621
{
1722
"description": "only RFC3339 not all of ISO 8601 are valid",
1823
"data": "2013-350T01:01:01",

0 commit comments

Comments
 (0)