Skip to content

Commit 54cc570

Browse files
committed
added null-handling tests for patternProperties
1 parent 2841984 commit 54cc570

File tree

7 files changed

+105
-0
lines changed

7 files changed

+105
-0
lines changed

tests/draft-next/patternProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,20 @@
152152
"valid": true
153153
}
154154
]
155+
},
156+
{
157+
"description": "patternProperties should properly handle null data",
158+
"schema": {
159+
"patternProperties": {
160+
"^.*bar$": {"type": "null"}
161+
}
162+
},
163+
"tests": [
164+
{
165+
"description": "null properties allowed",
166+
"data": {"foobar": null},
167+
"valid": true
168+
}
169+
]
155170
}
156171
]

tests/draft2019-09/patternProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,20 @@
152152
"valid": true
153153
}
154154
]
155+
},
156+
{
157+
"description": "patternProperties should properly handle null data",
158+
"schema": {
159+
"patternProperties": {
160+
"^.*bar$": {"type": "null"}
161+
}
162+
},
163+
"tests": [
164+
{
165+
"description": "null properties allowed",
166+
"data": {"foobar": null},
167+
"valid": true
168+
}
169+
]
155170
}
156171
]

tests/draft2020-12/patternProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,20 @@
152152
"valid": true
153153
}
154154
]
155+
},
156+
{
157+
"description": "patternProperties should properly handle null data",
158+
"schema": {
159+
"patternProperties": {
160+
"^.*bar$": {"type": "null"}
161+
}
162+
},
163+
"tests": [
164+
{
165+
"description": "null properties allowed",
166+
"data": {"foobar": null},
167+
"valid": true
168+
}
169+
]
155170
}
156171
]

tests/draft3/patternProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,20 @@
111111
"valid": false
112112
}
113113
]
114+
},
115+
{
116+
"description": "patternProperties should properly handle null data",
117+
"schema": {
118+
"patternProperties": {
119+
"^.*bar$": {"type": "null"}
120+
}
121+
},
122+
"tests": [
123+
{
124+
"description": "null properties allowed",
125+
"data": {"foobar": null},
126+
"valid": true
127+
}
128+
]
114129
}
115130
]

tests/draft4/patternProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,20 @@
116116
"valid": false
117117
}
118118
]
119+
},
120+
{
121+
"description": "patternProperties should properly handle null data",
122+
"schema": {
123+
"patternProperties": {
124+
"^.*bar$": {"type": "null"}
125+
}
126+
},
127+
"tests": [
128+
{
129+
"description": "null properties allowed",
130+
"data": {"foobar": null},
131+
"valid": true
132+
}
133+
]
119134
}
120135
]

tests/draft6/patternProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,20 @@
152152
"valid": true
153153
}
154154
]
155+
},
156+
{
157+
"description": "patternProperties should properly handle null data",
158+
"schema": {
159+
"patternProperties": {
160+
"^.*bar$": {"type": "null"}
161+
}
162+
},
163+
"tests": [
164+
{
165+
"description": "null properties allowed",
166+
"data": {"foobar": null},
167+
"valid": true
168+
}
169+
]
155170
}
156171
]

tests/draft7/patternProperties.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,20 @@
152152
"valid": true
153153
}
154154
]
155+
},
156+
{
157+
"description": "patternProperties should properly handle null data",
158+
"schema": {
159+
"patternProperties": {
160+
"^.*bar$": {"type": "null"}
161+
}
162+
},
163+
"tests": [
164+
{
165+
"description": "null properties allowed",
166+
"data": {"foobar": null},
167+
"valid": true
168+
}
169+
]
155170
}
156171
]

0 commit comments

Comments
 (0)