summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2020-09-05 07:55:55 -0400
committerJulian Berman <Julian@GrayVines.com>2020-09-05 07:55:55 -0400
commit1a4ea00149e70383506f24648bfb52a2278fe3f7 (patch)
tree25f11e134e9fa75f5d5030e853978e79a14d75cf
parentb3ebd208e200797c1235c614c779f015addf1d99 (diff)
downloadjsonschema-1a4ea00149e70383506f24648bfb52a2278fe3f7.tar.gz
Squashed 'json/' changes from fce9e9b3..21555a85
21555a85 Merge pull request #431 from ChALkeR/chalker/enum 87550ad6 Merge pull request #433 from notEthan/escaped_ref_in_def 57e31b49 refactor tests of escaped pointer refs to put ref'd schemas in definitions a21e4258 Add tests for objects in enum 8a129948 Remove invalid format:regex test; the spec doesn't mandate parsing correctness git-subtree-dir: json git-subtree-split: 21555a8540584447a9f8ea659accd0ce79bd36e5
-rw-r--r--tests/draft2019-09/enum.json10
-rw-r--r--tests/draft2019-09/optional/ecmascript-regex.json11
-rw-r--r--tests/draft3/ref.json14
-rw-r--r--tests/draft4/enum.json10
-rw-r--r--tests/draft4/optional/ecmascript-regex.json11
-rw-r--r--tests/draft4/ref.json14
-rw-r--r--tests/draft6/enum.json10
-rw-r--r--tests/draft6/optional/ecmascript-regex.json11
-rw-r--r--tests/draft6/ref.json14
-rw-r--r--tests/draft7/enum.json10
-rw-r--r--tests/draft7/optional/ecmascript-regex.json11
-rw-r--r--tests/draft7/ref.json14
12 files changed, 72 insertions, 68 deletions
diff --git a/tests/draft2019-09/enum.json b/tests/draft2019-09/enum.json
index 6844578..f085097 100644
--- a/tests/draft2019-09/enum.json
+++ b/tests/draft2019-09/enum.json
@@ -33,6 +33,16 @@
"description": "objects are deep compared",
"data": {"foo": false},
"valid": false
+ },
+ {
+ "description": "valid object matches",
+ "data": {"foo": 12},
+ "valid": true
+ },
+ {
+ "description": "extra properties in object is invalid",
+ "data": {"foo": 12, "boo": 42},
+ "valid": false
}
]
},
diff --git a/tests/draft2019-09/optional/ecmascript-regex.json b/tests/draft2019-09/optional/ecmascript-regex.json
index b9412e0..6ed6cbe 100644
--- a/tests/draft2019-09/optional/ecmascript-regex.json
+++ b/tests/draft2019-09/optional/ecmascript-regex.json
@@ -1,16 +1,5 @@
[
{
- "description": "ECMA 262 regex non-compliance",
- "schema": { "format": "regex" },
- "tests": [
- {
- "description": "ECMA 262 has no support for \\Z anchor from .NET",
- "data": "^\\S(|(.|\\n)*\\S)\\Z",
- "valid": false
- }
- ]
- },
- {
"description": "ECMA 262 regex $ does not match trailing newline",
"schema": {
"type": "string",
diff --git a/tests/draft3/ref.json b/tests/draft3/ref.json
index 74e963c..77b2947 100644
--- a/tests/draft3/ref.json
+++ b/tests/draft3/ref.json
@@ -75,13 +75,15 @@
{
"description": "escaped pointer ref",
"schema": {
- "tilde~field": {"type": "integer"},
- "slash/field": {"type": "integer"},
- "percent%field": {"type": "integer"},
+ "definitions": {
+ "tilde~field": {"type": "integer"},
+ "slash/field": {"type": "integer"},
+ "percent%field": {"type": "integer"}
+ },
"properties": {
- "tilde": {"$ref": "#/tilde~0field"},
- "slash": {"$ref": "#/slash~1field"},
- "percent": {"$ref": "#/percent%25field"}
+ "tilde": {"$ref": "#/definitions/tilde~0field"},
+ "slash": {"$ref": "#/definitions/slash~1field"},
+ "percent": {"$ref": "#/definitions/percent%25field"}
}
},
"tests": [
diff --git a/tests/draft4/enum.json b/tests/draft4/enum.json
index 6844578..f085097 100644
--- a/tests/draft4/enum.json
+++ b/tests/draft4/enum.json
@@ -33,6 +33,16 @@
"description": "objects are deep compared",
"data": {"foo": false},
"valid": false
+ },
+ {
+ "description": "valid object matches",
+ "data": {"foo": 12},
+ "valid": true
+ },
+ {
+ "description": "extra properties in object is invalid",
+ "data": {"foo": 12, "boo": 42},
+ "valid": false
}
]
},
diff --git a/tests/draft4/optional/ecmascript-regex.json b/tests/draft4/optional/ecmascript-regex.json
index b9412e0..6ed6cbe 100644
--- a/tests/draft4/optional/ecmascript-regex.json
+++ b/tests/draft4/optional/ecmascript-regex.json
@@ -1,16 +1,5 @@
[
{
- "description": "ECMA 262 regex non-compliance",
- "schema": { "format": "regex" },
- "tests": [
- {
- "description": "ECMA 262 has no support for \\Z anchor from .NET",
- "data": "^\\S(|(.|\\n)*\\S)\\Z",
- "valid": false
- }
- ]
- },
- {
"description": "ECMA 262 regex $ does not match trailing newline",
"schema": {
"type": "string",
diff --git a/tests/draft4/ref.json b/tests/draft4/ref.json
index fc3e94b..f88e963 100644
--- a/tests/draft4/ref.json
+++ b/tests/draft4/ref.json
@@ -75,13 +75,15 @@
{
"description": "escaped pointer ref",
"schema": {
- "tilde~field": {"type": "integer"},
- "slash/field": {"type": "integer"},
- "percent%field": {"type": "integer"},
+ "definitions": {
+ "tilde~field": {"type": "integer"},
+ "slash/field": {"type": "integer"},
+ "percent%field": {"type": "integer"}
+ },
"properties": {
- "tilde": {"$ref": "#/tilde~0field"},
- "slash": {"$ref": "#/slash~1field"},
- "percent": {"$ref": "#/percent%25field"}
+ "tilde": {"$ref": "#/definitions/tilde~0field"},
+ "slash": {"$ref": "#/definitions/slash~1field"},
+ "percent": {"$ref": "#/definitions/percent%25field"}
}
},
"tests": [
diff --git a/tests/draft6/enum.json b/tests/draft6/enum.json
index 6844578..f085097 100644
--- a/tests/draft6/enum.json
+++ b/tests/draft6/enum.json
@@ -33,6 +33,16 @@
"description": "objects are deep compared",
"data": {"foo": false},
"valid": false
+ },
+ {
+ "description": "valid object matches",
+ "data": {"foo": 12},
+ "valid": true
+ },
+ {
+ "description": "extra properties in object is invalid",
+ "data": {"foo": 12, "boo": 42},
+ "valid": false
}
]
},
diff --git a/tests/draft6/optional/ecmascript-regex.json b/tests/draft6/optional/ecmascript-regex.json
index b9412e0..6ed6cbe 100644
--- a/tests/draft6/optional/ecmascript-regex.json
+++ b/tests/draft6/optional/ecmascript-regex.json
@@ -1,16 +1,5 @@
[
{
- "description": "ECMA 262 regex non-compliance",
- "schema": { "format": "regex" },
- "tests": [
- {
- "description": "ECMA 262 has no support for \\Z anchor from .NET",
- "data": "^\\S(|(.|\\n)*\\S)\\Z",
- "valid": false
- }
- ]
- },
- {
"description": "ECMA 262 regex $ does not match trailing newline",
"schema": {
"type": "string",
diff --git a/tests/draft6/ref.json b/tests/draft6/ref.json
index 8eaba56..0138382 100644
--- a/tests/draft6/ref.json
+++ b/tests/draft6/ref.json
@@ -75,13 +75,15 @@
{
"description": "escaped pointer ref",
"schema": {
- "tilde~field": {"type": "integer"},
- "slash/field": {"type": "integer"},
- "percent%field": {"type": "integer"},
+ "definitions": {
+ "tilde~field": {"type": "integer"},
+ "slash/field": {"type": "integer"},
+ "percent%field": {"type": "integer"}
+ },
"properties": {
- "tilde": {"$ref": "#/tilde~0field"},
- "slash": {"$ref": "#/slash~1field"},
- "percent": {"$ref": "#/percent%25field"}
+ "tilde": {"$ref": "#/definitions/tilde~0field"},
+ "slash": {"$ref": "#/definitions/slash~1field"},
+ "percent": {"$ref": "#/definitions/percent%25field"}
}
},
"tests": [
diff --git a/tests/draft7/enum.json b/tests/draft7/enum.json
index 6844578..f085097 100644
--- a/tests/draft7/enum.json
+++ b/tests/draft7/enum.json
@@ -33,6 +33,16 @@
"description": "objects are deep compared",
"data": {"foo": false},
"valid": false
+ },
+ {
+ "description": "valid object matches",
+ "data": {"foo": 12},
+ "valid": true
+ },
+ {
+ "description": "extra properties in object is invalid",
+ "data": {"foo": 12, "boo": 42},
+ "valid": false
}
]
},
diff --git a/tests/draft7/optional/ecmascript-regex.json b/tests/draft7/optional/ecmascript-regex.json
index b9412e0..6ed6cbe 100644
--- a/tests/draft7/optional/ecmascript-regex.json
+++ b/tests/draft7/optional/ecmascript-regex.json
@@ -1,16 +1,5 @@
[
{
- "description": "ECMA 262 regex non-compliance",
- "schema": { "format": "regex" },
- "tests": [
- {
- "description": "ECMA 262 has no support for \\Z anchor from .NET",
- "data": "^\\S(|(.|\\n)*\\S)\\Z",
- "valid": false
- }
- ]
- },
- {
"description": "ECMA 262 regex $ does not match trailing newline",
"schema": {
"type": "string",
diff --git a/tests/draft7/ref.json b/tests/draft7/ref.json
index 5a8602e..01ba9fa 100644
--- a/tests/draft7/ref.json
+++ b/tests/draft7/ref.json
@@ -75,13 +75,15 @@
{
"description": "escaped pointer ref",
"schema": {
- "tilde~field": {"type": "integer"},
- "slash/field": {"type": "integer"},
- "percent%field": {"type": "integer"},
+ "definitions": {
+ "tilde~field": {"type": "integer"},
+ "slash/field": {"type": "integer"},
+ "percent%field": {"type": "integer"}
+ },
"properties": {
- "tilde": {"$ref": "#/tilde~0field"},
- "slash": {"$ref": "#/slash~1field"},
- "percent": {"$ref": "#/percent%25field"}
+ "tilde": {"$ref": "#/definitions/tilde~0field"},
+ "slash": {"$ref": "#/definitions/slash~1field"},
+ "percent": {"$ref": "#/definitions/percent%25field"}
}
},
"tests": [