Skip to content

Commit 278e5b3

Browse files
committed
added null-handling tests for additionalProperties
1 parent 9cb7da9 commit 278e5b3

File tree

7 files changed

+105
-0
lines changed

7 files changed

+105
-0
lines changed

tests/draft-next/additionalProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,20 @@
129129
"valid": false
130130
}
131131
]
132+
},
133+
{
134+
"description": "additionalProperties should properly handle null data",
135+
"schema": {
136+
"additionalProperties": {
137+
"type": null
138+
}
139+
},
140+
"tests": [
141+
{
142+
"description": "null properties allowed",
143+
"data": {"foo": null},
144+
"valid": true
145+
}
146+
]
132147
}
133148
]

tests/draft2019-09/additionalProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,20 @@
129129
"valid": false
130130
}
131131
]
132+
},
133+
{
134+
"description": "additionalProperties should properly handle null data",
135+
"schema": {
136+
"additionalProperties": {
137+
"type": null
138+
}
139+
},
140+
"tests": [
141+
{
142+
"description": "null properties allowed",
143+
"data": {"foo": null},
144+
"valid": true
145+
}
146+
]
132147
}
133148
]

tests/draft2020-12/additionalProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,20 @@
129129
"valid": false
130130
}
131131
]
132+
},
133+
{
134+
"description": "additionalProperties should properly handle null data",
135+
"schema": {
136+
"additionalProperties": {
137+
"type": null
138+
}
139+
},
140+
"tests": [
141+
{
142+
"description": "null properties allowed",
143+
"data": {"foo": null},
144+
"valid": true
145+
}
146+
]
132147
}
133148
]

tests/draft3/additionalProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,20 @@
129129
"valid": false
130130
}
131131
]
132+
},
133+
{
134+
"description": "additionalProperties should properly handle null data",
135+
"schema": {
136+
"additionalProperties": {
137+
"type": null
138+
}
139+
},
140+
"tests": [
141+
{
142+
"description": "null properties allowed",
143+
"data": {"foo": null},
144+
"valid": true
145+
}
146+
]
132147
}
133148
]

tests/draft4/additionalProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,20 @@
129129
"valid": false
130130
}
131131
]
132+
},
133+
{
134+
"description": "additionalProperties should properly handle null data",
135+
"schema": {
136+
"additionalProperties": {
137+
"type": null
138+
}
139+
},
140+
"tests": [
141+
{
142+
"description": "null properties allowed",
143+
"data": {"foo": null},
144+
"valid": true
145+
}
146+
]
132147
}
133148
]

tests/draft6/additionalProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,20 @@
129129
"valid": false
130130
}
131131
]
132+
},
133+
{
134+
"description": "additionalProperties should properly handle null data",
135+
"schema": {
136+
"additionalProperties": {
137+
"type": null
138+
}
139+
},
140+
"tests": [
141+
{
142+
"description": "null properties allowed",
143+
"data": {"foo": null},
144+
"valid": true
145+
}
146+
]
132147
}
133148
]

tests/draft7/additionalProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,20 @@
129129
"valid": false
130130
}
131131
]
132+
},
133+
{
134+
"description": "additionalProperties should properly handle null data",
135+
"schema": {
136+
"additionalProperties": {
137+
"type": null
138+
}
139+
},
140+
"tests": [
141+
{
142+
"description": "null properties allowed",
143+
"data": {"foo": null},
144+
"valid": true
145+
}
146+
]
132147
}
133148
]

0 commit comments

Comments
 (0)