Skip to content

Commit 9514122

Browse files
Merge pull request #388 from json-schema-org/ether/maxProperties=0
test that maxProperties = 0 means the object is empty
2 parents c3f4319 + 7646490 commit 9514122

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed

tests/draft2019-09/maxProperties.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,21 @@
3434
"valid": true
3535
}
3636
]
37+
},
38+
{
39+
"description": "maxProperties = 0 means the object is empty",
40+
"schema": { "maxProperties": 0 },
41+
"tests": [
42+
{
43+
"description": "no properties is valid",
44+
"data": {},
45+
"valid": true
46+
},
47+
{
48+
"description": "one property is invalid",
49+
"data": { "foo": 1 },
50+
"valid": false
51+
}
52+
]
3753
}
3854
]

tests/draft4/maxProperties.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,21 @@
3434
"valid": true
3535
}
3636
]
37+
},
38+
{
39+
"description": "maxProperties = 0 means the object is empty",
40+
"schema": { "maxProperties": 0 },
41+
"tests": [
42+
{
43+
"description": "no properties is valid",
44+
"data": {},
45+
"valid": true
46+
},
47+
{
48+
"description": "one property is invalid",
49+
"data": { "foo": 1 },
50+
"valid": false
51+
}
52+
]
3753
}
3854
]

tests/draft6/maxProperties.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,21 @@
3434
"valid": true
3535
}
3636
]
37+
},
38+
{
39+
"description": "maxProperties = 0 means the object is empty",
40+
"schema": { "maxProperties": 0 },
41+
"tests": [
42+
{
43+
"description": "no properties is valid",
44+
"data": {},
45+
"valid": true
46+
},
47+
{
48+
"description": "one property is invalid",
49+
"data": { "foo": 1 },
50+
"valid": false
51+
}
52+
]
3753
}
3854
]

tests/draft7/maxProperties.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,21 @@
3434
"valid": true
3535
}
3636
]
37+
},
38+
{
39+
"description": "maxProperties = 0 means the object is empty",
40+
"schema": { "maxProperties": 0 },
41+
"tests": [
42+
{
43+
"description": "no properties is valid",
44+
"data": {},
45+
"valid": true
46+
},
47+
{
48+
"description": "one property is invalid",
49+
"data": { "foo": 1 },
50+
"valid": false
51+
}
52+
]
3753
}
3854
]

0 commit comments

Comments
 (0)