Skip to content

Commit fa99135

Browse files
committed
draft-06: patternProperties keyword with boolean schemas
1 parent 5a888a6 commit fa99135

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/draft6/patternProperties.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,36 @@
106106
"valid": false
107107
}
108108
]
109+
},
110+
{
111+
"description": "patternProperties with boolean schemas",
112+
"schema": {
113+
"patternProperties": {
114+
"f.*": true,
115+
"b.*": false
116+
}
117+
},
118+
"tests": [
119+
{
120+
"description": "object with property matching schema true is valid",
121+
"data": {"foo": 1},
122+
"valid": true
123+
},
124+
{
125+
"description": "object with property matching schema false is invalid",
126+
"data": {"bar": 2},
127+
"valid": false
128+
},
129+
{
130+
"description": "object with both properties is invalid",
131+
"data": {"foo": 1, "bar": 2},
132+
"valid": false
133+
},
134+
{
135+
"description": "empty object is valid",
136+
"data": {},
137+
"valid": true
138+
}
139+
]
109140
}
110141
]

0 commit comments

Comments
 (0)