Skip to content

Commit 3d3bdf4

Browse files
committed
added null-handling tests for properties
1 parent 54cc570 commit 3d3bdf4

File tree

7 files changed

+105
-0
lines changed

7 files changed

+105
-0
lines changed

tests/draft-next/properties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,20 @@
163163
"valid": false
164164
}
165165
]
166+
},
167+
{
168+
"description": "properties should properly handle null data",
169+
"schema": {
170+
"properties": {
171+
"foo$": {"type": "null"}
172+
}
173+
},
174+
"tests": [
175+
{
176+
"description": "null properties allowed",
177+
"data": {"foo": null},
178+
"valid": true
179+
}
180+
]
166181
}
167182
]

tests/draft2019-09/properties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,20 @@
163163
"valid": false
164164
}
165165
]
166+
},
167+
{
168+
"description": "properties should properly handle null data",
169+
"schema": {
170+
"properties": {
171+
"foo$": {"type": "null"}
172+
}
173+
},
174+
"tests": [
175+
{
176+
"description": "null properties allowed",
177+
"data": {"foo": null},
178+
"valid": true
179+
}
180+
]
166181
}
167182
]

tests/draft2020-12/properties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,20 @@
163163
"valid": false
164164
}
165165
]
166+
},
167+
{
168+
"description": "properties should properly handle null data",
169+
"schema": {
170+
"properties": {
171+
"foo$": {"type": "null"}
172+
}
173+
},
174+
"tests": [
175+
{
176+
"description": "null properties allowed",
177+
"data": {"foo": null},
178+
"valid": true
179+
}
180+
]
166181
}
167182
]

tests/draft3/properties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,20 @@
9393
"valid": false
9494
}
9595
]
96+
},
97+
{
98+
"description": "properties should properly handle null data",
99+
"schema": {
100+
"properties": {
101+
"foo$": {"type": "null"}
102+
}
103+
},
104+
"tests": [
105+
{
106+
"description": "null properties allowed",
107+
"data": {"foo": null},
108+
"valid": true
109+
}
110+
]
96111
}
97112
]

tests/draft4/properties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,20 @@
132132
"valid": false
133133
}
134134
]
135+
},
136+
{
137+
"description": "properties should properly handle null data",
138+
"schema": {
139+
"properties": {
140+
"foo$": {"type": "null"}
141+
}
142+
},
143+
"tests": [
144+
{
145+
"description": "null properties allowed",
146+
"data": {"foo": null},
147+
"valid": true
148+
}
149+
]
135150
}
136151
]

tests/draft6/properties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,20 @@
163163
"valid": false
164164
}
165165
]
166+
},
167+
{
168+
"description": "properties should properly handle null data",
169+
"schema": {
170+
"properties": {
171+
"foo$": {"type": "null"}
172+
}
173+
},
174+
"tests": [
175+
{
176+
"description": "null properties allowed",
177+
"data": {"foo": null},
178+
"valid": true
179+
}
180+
]
166181
}
167182
]

tests/draft7/properties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,20 @@
163163
"valid": false
164164
}
165165
]
166+
},
167+
{
168+
"description": "properties should properly handle null data",
169+
"schema": {
170+
"properties": {
171+
"foo$": {"type": "null"}
172+
}
173+
},
174+
"tests": [
175+
{
176+
"description": "null properties allowed",
177+
"data": {"foo": null},
178+
"valid": true
179+
}
180+
]
166181
}
167182
]

0 commit comments

Comments
 (0)