Skip to content

Commit

Permalink
test: unevaluatedProperties not affected by propertyNames
Browse files Browse the repository at this point in the history
  • Loading branch information
santhosh-tekuri authored and jdesrosiers committed Mar 10, 2023
1 parent 8292706 commit 19947ea
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/draft-next/unevaluatedProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -1516,5 +1516,27 @@
"valid": false
}
]
},
{
"description": "unevaluatedProperties not affected by propertyNames",
"schema": {
"$schema": "https://json-schema.org/draft/next/schema",
"propertyNames": {"maxLength": 1},
"unevaluatedProperties": {
"type": "number"
}
},
"tests": [
{
"description": "allows only number properties",
"data": {"a": 1},
"valid": true
},
{
"description": "string property is invalid",
"data": {"a": "b"},
"valid": false
}
]
}
]
22 changes: 22 additions & 0 deletions tests/draft2019-09/unevaluatedProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -1419,5 +1419,27 @@
"valid": true
}
]
},
{
"description": "unevaluatedProperties not affected by propertyNames",
"schema": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"propertyNames": {"maxLength": 1},
"unevaluatedProperties": {
"type": "number"
}
},
"tests": [
{
"description": "allows only number properties",
"data": {"a": 1},
"valid": true
},
{
"description": "string property is invalid",
"data": {"a": "b"},
"valid": false
}
]
}
]
22 changes: 22 additions & 0 deletions tests/draft2020-12/unevaluatedProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -1419,5 +1419,27 @@
"valid": true
}
]
},
{
"description": "unevaluatedProperties not affected by propertyNames",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"propertyNames": {"maxLength": 1},
"unevaluatedProperties": {
"type": "number"
}
},
"tests": [
{
"description": "allows only number properties",
"data": {"a": 1},
"valid": true
},
{
"description": "string property is invalid",
"data": {"a": "b"},
"valid": false
}
]
}
]

0 comments on commit 19947ea

Please sign in to comment.