summaryrefslogtreecommitdiff
path: root/tests/draft7/propertyNames.json
diff options
context:
space:
mode:
Diffstat (limited to 'tests/draft7/propertyNames.json')
-rw-r--r--tests/draft7/propertyNames.json29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/draft7/propertyNames.json b/tests/draft7/propertyNames.json
index 8423690..f0788e6 100644
--- a/tests/draft7/propertyNames.json
+++ b/tests/draft7/propertyNames.json
@@ -44,6 +44,35 @@
]
},
{
+ "description": "propertyNames validation with pattern",
+ "schema": {
+ "propertyNames": { "pattern": "^a+$" }
+ },
+ "tests": [
+ {
+ "description": "matching property names valid",
+ "data": {
+ "a": {},
+ "aa": {},
+ "aaa": {}
+ },
+ "valid": true
+ },
+ {
+ "description": "non-matching property name is invalid",
+ "data": {
+ "aaA": {}
+ },
+ "valid": false
+ },
+ {
+ "description": "object without properties is valid",
+ "data": {},
+ "valid": true
+ }
+ ]
+ },
+ {
"description": "propertyNames with boolean schema true",
"schema": {"propertyNames": true},
"tests": [