summaryrefslogtreecommitdiff
path: root/json/tests/draft7/minProperties.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests/draft7/minProperties.json')
-rw-r--r--json/tests/draft7/minProperties.json54
1 files changed, 54 insertions, 0 deletions
diff --git a/json/tests/draft7/minProperties.json b/json/tests/draft7/minProperties.json
new file mode 100644
index 0000000..9f74f78
--- /dev/null
+++ b/json/tests/draft7/minProperties.json
@@ -0,0 +1,54 @@
+[
+ {
+ "description": "minProperties validation",
+ "schema": {"minProperties": 1},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "ignores arrays",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "ignores strings",
+ "data": "",
+ "valid": true
+ },
+ {
+ "description": "ignores other non-objects",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "minProperties validation with a decimal",
+ "schema": {"minProperties": 1.0},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": {},
+ "valid": false
+ }
+ ]
+ }
+]