Skip to content

Commit 6d455c8

Browse files
committed
Squashed 'json/' changes from 09fd353f..0aefbb3d
0aefbb3d Merge pull request #491 from jdesrosiers/object-contains-tests 336ef8d2 Merge pull request #452 from LeifRilbe/rilbe/propertyNames-with-pattern 2dfbc79c Simplify the test case names as well. b6d0649d Add tests for contains with objects da687ca5 Enforce a consistent code style for contains tests b163efcf Merge pull request #490 from jdesrosiers/draft-future 7c8cb488 Initialize draft-future with 2020-12 tests 4d65d2df Merge pull request #483 from kylef/kylef/date ee9dcaa7 Merge pull request #485 from marksparkza/contains-with-false-if eaa5bffc Merge pull request #489 from json-schema-org/ether/more-recursiveRef 7c33b533 dynamic $recursiveRef test with cousin $recursiveAnchors 8a3a542b Fix invalid JSON error 8a89f58e Add tests combining remote refs and defs 3aec0d14 Add tests combining relative refs and defs a107d196 fix: $defs -> definitions in draft 6,7 tests 0c223de2 Remove a test for undefined $id behavior 4efec180 Test that "contains" does not fail due to false "if" subschema bf383b4c fix: make identifiers unique across tests 812f1f08 Merge pull request #484 from json-schema-org/ether/schemas-under-unknown-keywords 64f6b850 Test that identifiers are not found inside unrecognized keywords c69a89c6 Stricter date format constraints 93193442 Test cases for propertyNames with pattern - update after PR feedback. 8e4aad95 Test cases for propertyNames with pattern. git-subtree-dir: json git-subtree-split: 0aefbb3d80e0caa22f3782677cf09c61b2205aa7
1 parent c19f0b4 commit 6d455c8

File tree

102 files changed

+12887
-101
lines changed

Some content is hidden

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

102 files changed

+12887
-101
lines changed

remotes/ref-and-definitions.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$id": "http://localhost:1234/ref-and-definitions.json",
3+
"definitions": {
4+
"inner": {
5+
"properties": {
6+
"bar": { "type": "string" }
7+
}
8+
}
9+
},
10+
"allOf": [ { "$ref": "#/definitions/inner" } ]
11+
}

remotes/ref-and-defs.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$id": "http://localhost:1234/ref-and-defs.json",
3+
"$defs": {
4+
"inner": {
5+
"properties": {
6+
"bar": { "type": "string" }
7+
}
8+
}
9+
},
10+
"$ref": "#/$defs/inner"
11+
}
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
[
2+
{
3+
"description":
4+
"additionalProperties being false does not allow other properties",
5+
"schema": {
6+
"properties": {"foo": {}, "bar": {}},
7+
"patternProperties": { "^v": {} },
8+
"additionalProperties": false
9+
},
10+
"tests": [
11+
{
12+
"description": "no additional properties is valid",
13+
"data": {"foo": 1},
14+
"valid": true
15+
},
16+
{
17+
"description": "an additional property is invalid",
18+
"data": {"foo" : 1, "bar" : 2, "quux" : "boom"},
19+
"valid": false
20+
},
21+
{
22+
"description": "ignores arrays",
23+
"data": [1, 2, 3],
24+
"valid": true
25+
},
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+
},
36+
{
37+
"description": "patternProperties are not additional properties",
38+
"data": {"foo":1, "vroom": 2},
39+
"valid": true
40+
}
41+
]
42+
},
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+
},
62+
{
63+
"description":
64+
"additionalProperties allows a schema which should validate",
65+
"schema": {
66+
"properties": {"foo": {}, "bar": {}},
67+
"additionalProperties": {"type": "boolean"}
68+
},
69+
"tests": [
70+
{
71+
"description": "no additional properties is valid",
72+
"data": {"foo": 1},
73+
"valid": true
74+
},
75+
{
76+
"description": "an additional valid property is valid",
77+
"data": {"foo" : 1, "bar" : 2, "quux" : true},
78+
"valid": true
79+
},
80+
{
81+
"description": "an additional invalid property is invalid",
82+
"data": {"foo" : 1, "bar" : 2, "quux" : 12},
83+
"valid": false
84+
}
85+
]
86+
},
87+
{
88+
"description":
89+
"additionalProperties can exist by itself",
90+
"schema": {
91+
"additionalProperties": {"type": "boolean"}
92+
},
93+
"tests": [
94+
{
95+
"description": "an additional valid property is valid",
96+
"data": {"foo" : true},
97+
"valid": true
98+
},
99+
{
100+
"description": "an additional invalid property is invalid",
101+
"data": {"foo" : 1},
102+
"valid": false
103+
}
104+
]
105+
},
106+
{
107+
"description": "additionalProperties are allowed by default",
108+
"schema": {"properties": {"foo": {}, "bar": {}}},
109+
"tests": [
110+
{
111+
"description": "additional properties are allowed",
112+
"data": {"foo": 1, "bar": 2, "quux": true},
113+
"valid": true
114+
}
115+
]
116+
},
117+
{
118+
"description": "additionalProperties should not look in applicators",
119+
"schema": {
120+
"allOf": [
121+
{"properties": {"foo": {}}}
122+
],
123+
"additionalProperties": {"type": "boolean"}
124+
},
125+
"tests": [
126+
{
127+
"description": "properties defined in allOf are not examined",
128+
"data": {"foo": 1, "bar": true},
129+
"valid": false
130+
}
131+
]
132+
}
133+
]

0 commit comments

Comments
 (0)