Skip to content

Commit bce6a47

Browse files
authored
Merge pull request #793 from 414owen/os/fix-unevaluatedproperties-test-case
Fix `unevaluatedProperties with adjacent bool additionalProperties` test case
2 parents a17eb1f + e0e431f commit bce6a47

3 files changed

Lines changed: 73 additions & 7 deletions

File tree

tests/draft2019-09/unevaluatedProperties.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
]
133133
},
134134
{
135-
"description": "unevaluatedProperties with adjacent additionalProperties",
135+
"description": "unevaluatedProperties with adjacent bool additionalProperties",
136136
"schema": {
137137
"$schema": "https://json-schema.org/draft/2019-09/schema",
138138
"type": "object",
@@ -160,6 +160,35 @@
160160
}
161161
]
162162
},
163+
{
164+
"description": "unevaluatedProperties with adjacent non-bool additionalProperties",
165+
"schema": {
166+
"$schema": "https://json-schema.org/draft/2019-09/schema",
167+
"type": "object",
168+
"properties": {
169+
"foo": { "type": "string" }
170+
},
171+
"additionalProperties": {"type": "string"},
172+
"unevaluatedProperties": false
173+
},
174+
"tests": [
175+
{
176+
"description": "with no additional properties",
177+
"data": {
178+
"foo": "foo"
179+
},
180+
"valid": true
181+
},
182+
{
183+
"description": "with additional properties",
184+
"data": {
185+
"foo": "foo",
186+
"bar": "bar"
187+
},
188+
"valid": true
189+
}
190+
]
191+
},
163192
{
164193
"description": "unevaluatedProperties with nested properties",
165194
"schema": {

tests/draft2020-12/unevaluatedProperties.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@
130130
"description": "unevaluatedProperties with adjacent bool additionalProperties",
131131
"schema": {
132132
"$schema": "https://json-schema.org/draft/2020-12/schema",
133+
"type": "object",
134+
"properties": {
135+
"foo": { "type": "string" }
136+
},
133137
"additionalProperties": true,
134138
"unevaluatedProperties": false
135139
},
@@ -155,24 +159,28 @@
155159
"description": "unevaluatedProperties with adjacent non-bool additionalProperties",
156160
"schema": {
157161
"$schema": "https://json-schema.org/draft/2020-12/schema",
158-
"additionalProperties": { "type": "string" },
162+
"type": "object",
163+
"properties": {
164+
"foo": { "type": "string" }
165+
},
166+
"additionalProperties": {"type": "string"},
159167
"unevaluatedProperties": false
160168
},
161169
"tests": [
162170
{
163-
"description": "with only valid additional properties",
171+
"description": "with no additional properties",
164172
"data": {
165173
"foo": "foo"
166174
},
167175
"valid": true
168176
},
169177
{
170-
"description": "with invalid additional properties",
178+
"description": "with additional properties",
171179
"data": {
172180
"foo": "foo",
173-
"bar": 1
181+
"bar": "bar"
174182
},
175-
"valid": false
183+
"valid": true
176184
}
177185
]
178186
},

tests/v1/unevaluatedProperties.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
]
133133
},
134134
{
135-
"description": "unevaluatedProperties with adjacent additionalProperties",
135+
"description": "unevaluatedProperties with adjacent bool additionalProperties",
136136
"schema": {
137137
"$schema": "https://json-schema.org/v1",
138138
"type": "object",
@@ -160,6 +160,35 @@
160160
}
161161
]
162162
},
163+
{
164+
"description": "unevaluatedProperties with adjacent non-bool additionalProperties",
165+
"schema": {
166+
"$schema": "https://json-schema.org/v1",
167+
"type": "object",
168+
"properties": {
169+
"foo": { "type": "string" }
170+
},
171+
"additionalProperties": {"type": "string"},
172+
"unevaluatedProperties": false
173+
},
174+
"tests": [
175+
{
176+
"description": "with no additional properties",
177+
"data": {
178+
"foo": "foo"
179+
},
180+
"valid": true
181+
},
182+
{
183+
"description": "with additional properties",
184+
"data": {
185+
"foo": "foo",
186+
"bar": "bar"
187+
},
188+
"valid": true
189+
}
190+
]
191+
},
163192
{
164193
"description": "unevaluatedProperties with nested properties",
165194
"schema": {

0 commit comments

Comments
 (0)