64 lines
1.3 KiB
JSON
64 lines
1.3 KiB
JSON
[
|
|
{
|
|
"description": "maxProperties validation",
|
|
"schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"maxProperties": 2
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "shorter is valid",
|
|
"data": {},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "exact length is valid",
|
|
"data": {},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "too long is invalid",
|
|
"data": {},
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "maxProperties validation with a decimal",
|
|
"schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"maxProperties": 2.0
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "shorter is valid",
|
|
"data": {},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "too long is invalid",
|
|
"data": {},
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "maxProperties = 0 means the object is empty",
|
|
"schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"maxProperties": 0
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "no properties is valid",
|
|
"data": {},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "one property is invalid",
|
|
"data": {},
|
|
"valid": false
|
|
}
|
|
]
|
|
}
|
|
] |