summaryrefslogtreecommitdiff
path: root/json/tests
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2020-06-11 18:25:39 -0400
committerJulian Berman <Julian@GrayVines.com>2020-06-11 18:25:39 -0400
commit9ffc81e628d0da306ab18a4579282a6cf0e18a6d (patch)
tree3e8d64da86657fedbc31e3c166175b9a4ed7b6bb /json/tests
parent9d5edb4749ab1f6194aa5c7c099c6e6fd402c4cf (diff)
parentba8f9ae3bb8a191c660231aab30a3cd4a67e7bcb (diff)
downloadjsonschema-9ffc81e628d0da306ab18a4579282a6cf0e18a6d.tar.gz
Merge commit 'ba8f9ae3bb8a191c660231aab30a3cd4a67e7bcb'
* commit 'ba8f9ae3bb8a191c660231aab30a3cd4a67e7bcb': Squashed 'json/' changes from 817b724b7..57001d26b
Diffstat (limited to 'json/tests')
-rw-r--r--json/tests/draft2019-09/additionalItems.json33
-rw-r--r--json/tests/draft2019-09/additionalProperties.json2
-rw-r--r--json/tests/draft2019-09/optional/format/ipv4.json5
-rw-r--r--json/tests/draft3/additionalItems.json16
-rw-r--r--json/tests/draft3/additionalProperties.json2
-rw-r--r--json/tests/draft4/additionalItems.json33
-rw-r--r--json/tests/draft4/additionalProperties.json2
-rw-r--r--json/tests/draft4/optional/format/ipv4.json5
-rw-r--r--json/tests/draft6/additionalItems.json33
-rw-r--r--json/tests/draft6/additionalProperties.json2
-rw-r--r--json/tests/draft6/optional/format/ipv4.json5
-rw-r--r--json/tests/draft7/additionalItems.json33
-rw-r--r--json/tests/draft7/additionalProperties.json2
-rw-r--r--json/tests/draft7/optional/format/ipv4.json5
14 files changed, 173 insertions, 5 deletions
diff --git a/json/tests/draft2019-09/additionalItems.json b/json/tests/draft2019-09/additionalItems.json
index 69ea5e3..ee46b61 100644
--- a/json/tests/draft2019-09/additionalItems.json
+++ b/json/tests/draft2019-09/additionalItems.json
@@ -93,5 +93,38 @@
"valid": true
}
]
+ },
+ {
+ "description": "additionalItems should not look in applicators, valid case",
+ "schema": {
+ "allOf": [
+ { "items": [ { "type": "integer" } ] }
+ ],
+ "additionalItems": { "type": "boolean" }
+ },
+ "tests": [
+ {
+ "description": "items defined in allOf are not examined",
+ "data": [ 1, null ],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "additionalItems should not look in applicators, invalid case",
+ "schema": {
+ "allOf": [
+ { "items": [ { "type": "integer" }, { "type": "string" } ] }
+ ],
+ "items": [ {"type": "integer" } ],
+ "additionalItems": { "type": "boolean" }
+ },
+ "tests": [
+ {
+ "description": "items defined in allOf are not examined",
+ "data": [ 1, "hello" ],
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft2019-09/additionalProperties.json b/json/tests/draft2019-09/additionalProperties.json
index ffeac6b..381275a 100644
--- a/json/tests/draft2019-09/additionalProperties.json
+++ b/json/tests/draft2019-09/additionalProperties.json
@@ -124,7 +124,7 @@
},
"tests": [
{
- "description": "properties defined in allOf are not allowed",
+ "description": "properties defined in allOf are not examined",
"data": {"foo": 1, "bar": true},
"valid": false
}
diff --git a/json/tests/draft2019-09/optional/format/ipv4.json b/json/tests/draft2019-09/optional/format/ipv4.json
index 661148a..8b99b9f 100644
--- a/json/tests/draft2019-09/optional/format/ipv4.json
+++ b/json/tests/draft2019-09/optional/format/ipv4.json
@@ -27,6 +27,11 @@
"description": "an IP address as an integer",
"data": "0x7f000001",
"valid": false
+ },
+ {
+ "description": "an IP address as an integer (decimal)",
+ "data": "2130706433",
+ "valid": false
}
]
}
diff --git a/json/tests/draft3/additionalItems.json b/json/tests/draft3/additionalItems.json
index 3868cb4..1e8ebdc 100644
--- a/json/tests/draft3/additionalItems.json
+++ b/json/tests/draft3/additionalItems.json
@@ -93,5 +93,21 @@
"valid": true
}
]
+ },
+ {
+ "description": "additionalItems should not look in applicators",
+ "schema": {
+ "extends": [
+ { "items": [ { "type": "integer" } ] }
+ ],
+ "additionalItems": { "type": "boolean" }
+ },
+ "tests": [
+ {
+ "description": "items defined in extends are not examined",
+ "data": [ 1, null ],
+ "valid": true
+ }
+ ]
}
]
diff --git a/json/tests/draft3/additionalProperties.json b/json/tests/draft3/additionalProperties.json
index bfb0844..4620618 100644
--- a/json/tests/draft3/additionalProperties.json
+++ b/json/tests/draft3/additionalProperties.json
@@ -124,7 +124,7 @@
},
"tests": [
{
- "description": "properties defined in extends are not allowed",
+ "description": "properties defined in extends are not examined",
"data": {"foo": 1, "bar": true},
"valid": false
}
diff --git a/json/tests/draft4/additionalItems.json b/json/tests/draft4/additionalItems.json
index 69ea5e3..ee46b61 100644
--- a/json/tests/draft4/additionalItems.json
+++ b/json/tests/draft4/additionalItems.json
@@ -93,5 +93,38 @@
"valid": true
}
]
+ },
+ {
+ "description": "additionalItems should not look in applicators, valid case",
+ "schema": {
+ "allOf": [
+ { "items": [ { "type": "integer" } ] }
+ ],
+ "additionalItems": { "type": "boolean" }
+ },
+ "tests": [
+ {
+ "description": "items defined in allOf are not examined",
+ "data": [ 1, null ],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "additionalItems should not look in applicators, invalid case",
+ "schema": {
+ "allOf": [
+ { "items": [ { "type": "integer" }, { "type": "string" } ] }
+ ],
+ "items": [ {"type": "integer" } ],
+ "additionalItems": { "type": "boolean" }
+ },
+ "tests": [
+ {
+ "description": "items defined in allOf are not examined",
+ "data": [ 1, "hello" ],
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft4/additionalProperties.json b/json/tests/draft4/additionalProperties.json
index ffeac6b..381275a 100644
--- a/json/tests/draft4/additionalProperties.json
+++ b/json/tests/draft4/additionalProperties.json
@@ -124,7 +124,7 @@
},
"tests": [
{
- "description": "properties defined in allOf are not allowed",
+ "description": "properties defined in allOf are not examined",
"data": {"foo": 1, "bar": true},
"valid": false
}
diff --git a/json/tests/draft4/optional/format/ipv4.json b/json/tests/draft4/optional/format/ipv4.json
index 661148a..8b99b9f 100644
--- a/json/tests/draft4/optional/format/ipv4.json
+++ b/json/tests/draft4/optional/format/ipv4.json
@@ -27,6 +27,11 @@
"description": "an IP address as an integer",
"data": "0x7f000001",
"valid": false
+ },
+ {
+ "description": "an IP address as an integer (decimal)",
+ "data": "2130706433",
+ "valid": false
}
]
}
diff --git a/json/tests/draft6/additionalItems.json b/json/tests/draft6/additionalItems.json
index 69ea5e3..ee46b61 100644
--- a/json/tests/draft6/additionalItems.json
+++ b/json/tests/draft6/additionalItems.json
@@ -93,5 +93,38 @@
"valid": true
}
]
+ },
+ {
+ "description": "additionalItems should not look in applicators, valid case",
+ "schema": {
+ "allOf": [
+ { "items": [ { "type": "integer" } ] }
+ ],
+ "additionalItems": { "type": "boolean" }
+ },
+ "tests": [
+ {
+ "description": "items defined in allOf are not examined",
+ "data": [ 1, null ],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "additionalItems should not look in applicators, invalid case",
+ "schema": {
+ "allOf": [
+ { "items": [ { "type": "integer" }, { "type": "string" } ] }
+ ],
+ "items": [ {"type": "integer" } ],
+ "additionalItems": { "type": "boolean" }
+ },
+ "tests": [
+ {
+ "description": "items defined in allOf are not examined",
+ "data": [ 1, "hello" ],
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft6/additionalProperties.json b/json/tests/draft6/additionalProperties.json
index ffeac6b..381275a 100644
--- a/json/tests/draft6/additionalProperties.json
+++ b/json/tests/draft6/additionalProperties.json
@@ -124,7 +124,7 @@
},
"tests": [
{
- "description": "properties defined in allOf are not allowed",
+ "description": "properties defined in allOf are not examined",
"data": {"foo": 1, "bar": true},
"valid": false
}
diff --git a/json/tests/draft6/optional/format/ipv4.json b/json/tests/draft6/optional/format/ipv4.json
index 661148a..8b99b9f 100644
--- a/json/tests/draft6/optional/format/ipv4.json
+++ b/json/tests/draft6/optional/format/ipv4.json
@@ -27,6 +27,11 @@
"description": "an IP address as an integer",
"data": "0x7f000001",
"valid": false
+ },
+ {
+ "description": "an IP address as an integer (decimal)",
+ "data": "2130706433",
+ "valid": false
}
]
}
diff --git a/json/tests/draft7/additionalItems.json b/json/tests/draft7/additionalItems.json
index 69ea5e3..ee46b61 100644
--- a/json/tests/draft7/additionalItems.json
+++ b/json/tests/draft7/additionalItems.json
@@ -93,5 +93,38 @@
"valid": true
}
]
+ },
+ {
+ "description": "additionalItems should not look in applicators, valid case",
+ "schema": {
+ "allOf": [
+ { "items": [ { "type": "integer" } ] }
+ ],
+ "additionalItems": { "type": "boolean" }
+ },
+ "tests": [
+ {
+ "description": "items defined in allOf are not examined",
+ "data": [ 1, null ],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "additionalItems should not look in applicators, invalid case",
+ "schema": {
+ "allOf": [
+ { "items": [ { "type": "integer" }, { "type": "string" } ] }
+ ],
+ "items": [ {"type": "integer" } ],
+ "additionalItems": { "type": "boolean" }
+ },
+ "tests": [
+ {
+ "description": "items defined in allOf are not examined",
+ "data": [ 1, "hello" ],
+ "valid": false
+ }
+ ]
}
]
diff --git a/json/tests/draft7/additionalProperties.json b/json/tests/draft7/additionalProperties.json
index ffeac6b..381275a 100644
--- a/json/tests/draft7/additionalProperties.json
+++ b/json/tests/draft7/additionalProperties.json
@@ -124,7 +124,7 @@
},
"tests": [
{
- "description": "properties defined in allOf are not allowed",
+ "description": "properties defined in allOf are not examined",
"data": {"foo": 1, "bar": true},
"valid": false
}
diff --git a/json/tests/draft7/optional/format/ipv4.json b/json/tests/draft7/optional/format/ipv4.json
index 661148a..8b99b9f 100644
--- a/json/tests/draft7/optional/format/ipv4.json
+++ b/json/tests/draft7/optional/format/ipv4.json
@@ -27,6 +27,11 @@
"description": "an IP address as an integer",
"data": "0x7f000001",
"valid": false
+ },
+ {
+ "description": "an IP address as an integer (decimal)",
+ "data": "2130706433",
+ "valid": false
}
]
}