diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2017-09-14 17:55:27 -0400 |
---|---|---|
committer | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2017-09-18 17:35:58 -0400 |
commit | 7b3d369d8ed11e0c998c09d19aa37ed3e721b425 (patch) | |
tree | a85a123345235b7176ed8143a071fce6fe851201 /src/third_party | |
parent | 29faa71a0bdf07a1c9af09cf33e2953d816de1cf (diff) | |
download | mongo-7b3d369d8ed11e0c998c09d19aa37ed3e721b425.tar.gz |
SERVER-30647: Modify the 3rd party JSON Schema test suite to only test keywords supported by MongoDB
Diffstat (limited to 'src/third_party')
13 files changed, 44 insertions, 133 deletions
diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/additionalItems.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/additionalItems.json index abecc578be3..529b9bbc368 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/additionalItems.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/additionalItems.json @@ -1,9 +1,10 @@ [ { "description": "additionalItems as schema", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { "items": [{}], - "additionalItems": {"type": "integer"} + "additionalItems": {"type": "number"} }, "tests": [ { @@ -75,7 +76,8 @@ }, { "description": "additionalItems are allowed by default", - "schema": {"items": [{"type": "integer"}]}, + "note": "Instances of 'integer' in this test have been replaced with 'number'.", + "schema": {"items": [{"type": "number"}]}, "tests": [ { "description": "only the first item is validated", diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/additionalProperties.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/additionalProperties.json index 90d760734e9..25fda79ac55 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/additionalProperties.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/additionalProperties.json @@ -7,6 +7,8 @@ "patternProperties": { "^v": {} }, "additionalProperties": false }, + "banFromTopLevel": true, + "note": "Cannot run this schema at the top-level because it is unaware of the _id field.", "tests": [ { "description": "no additional properties is valid", @@ -47,6 +49,8 @@ "properties": {"foo": {}, "bar": {}}, "additionalProperties": {"type": "boolean"} }, + "banFromTopLevel": true, + "note": "Cannot run this schema at the top-level because it is unaware of the _id field.", "tests": [ { "description": "no additional properties is valid", @@ -71,6 +75,8 @@ "schema": { "additionalProperties": {"type": "boolean"} }, + "banFromTopLevel": true, + "note": "Cannot run this schema at the top-level because it is unaware of the _id field.", "tests": [ { "description": "an additional valid property is valid", diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/allOf.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/allOf.json index bbb5f89e4bc..8e4d478e5df 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/allOf.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/allOf.json @@ -1,11 +1,12 @@ [ { "description": "allOf", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { "allOf": [ { "properties": { - "bar": {"type": "integer"} + "bar": {"type": "number"} }, "required": ["bar"] }, @@ -42,8 +43,9 @@ }, { "description": "allOf with base schema", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { - "properties": {"bar": {"type": "integer"}}, + "properties": {"bar": {"type": "number"}}, "required": ["bar"], "allOf" : [ { diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/anyOf.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/anyOf.json index a58714afd89..f547db5feeb 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/anyOf.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/anyOf.json @@ -1,40 +1,5 @@ [ { - "description": "anyOf", - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "minimum": 2 - } - ] - }, - "tests": [ - { - "description": "first anyOf valid", - "data": 1, - "valid": true - }, - { - "description": "second anyOf valid", - "data": 2.5, - "valid": true - }, - { - "description": "both anyOf valid", - "data": 3, - "valid": true - }, - { - "description": "neither anyOf valid", - "data": 1.5, - "valid": false - } - ] - }, - { "description": "anyOf with base schema", "schema": { "type": "string", diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/dependencies.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/dependencies.json index 38effa1a15f..58e730128ad 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/dependencies.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/dependencies.json @@ -82,12 +82,13 @@ }, { "description": "multiple dependencies subschema", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { "dependencies": { "bar": { "properties": { - "foo": {"type": "integer"}, - "bar": {"type": "integer"} + "foo": {"type": "number"}, + "bar": {"type": "number"} } } } diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/items.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/items.json index 6a4e648f738..4699ff785ff 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/items.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/items.json @@ -1,8 +1,9 @@ [ { "description": "a schema given for items", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { - "items": {"type": "integer"} + "items": {"type": "number"} }, "tests": [ { @@ -32,9 +33,10 @@ }, { "description": "an array of schemas for items", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { "items": [ - {"type": "integer"}, + {"type": "number"}, {"type": "string"} ] }, diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/maxProperties.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/maxProperties.json index 513731e4c88..9b12ef79efa 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/maxProperties.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/maxProperties.json @@ -2,6 +2,8 @@ { "description": "maxProperties validation", "schema": {"maxProperties": 2}, + "banFromTopLevel": true, + "note": "Cannot run this schema at the top-level because it is unaware of the _id field.", "tests": [ { "description": "shorter is valid", diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/minProperties.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/minProperties.json index 49a0726e01c..fd1e47d0b44 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/minProperties.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/minProperties.json @@ -2,6 +2,8 @@ { "description": "minProperties validation", "schema": {"minProperties": 1}, + "banFromTopLevel": true, + "note": "Cannot run this schema at the top-level because it is unaware of the _id field.", "tests": [ { "description": "longer is valid", diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/not.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/not.json index cbb7f46bf8b..fd839fd1529 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/not.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/not.json @@ -1,8 +1,9 @@ [ { "description": "not", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { - "not": {"type": "integer"} + "not": {"type": "number"} }, "tests": [ { @@ -19,8 +20,9 @@ }, { "description": "not multiple types", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { - "not": {"type": ["integer", "boolean"]} + "not": {"type": ["number", "boolean"]} }, "tests": [ { diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/oneOf.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/oneOf.json index 1eaa4e47949..0e4f2d805b2 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/oneOf.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/oneOf.json @@ -1,40 +1,5 @@ [ { - "description": "oneOf", - "schema": { - "oneOf": [ - { - "type": "integer" - }, - { - "minimum": 2 - } - ] - }, - "tests": [ - { - "description": "first oneOf valid", - "data": 1, - "valid": true - }, - { - "description": "second oneOf valid", - "data": 2.5, - "valid": true - }, - { - "description": "both oneOf valid", - "data": 3, - "valid": false - }, - { - "description": "neither oneOf valid", - "data": 1.5, - "valid": false - } - ] - }, - { "description": "oneOf with base schema", "schema": { "type": "string", diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/patternProperties.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/patternProperties.json index 5f741dfca60..3615db5b0d0 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/patternProperties.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/patternProperties.json @@ -2,9 +2,10 @@ { "description": "patternProperties validates properties matching a regex", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { "patternProperties": { - "f.*o": {"type": "integer"} + "f.*o": {"type": "number"} } }, "tests": [ @@ -49,10 +50,13 @@ "description": "multiple simultaneous patternProperties are validated", "schema": { "patternProperties": { - "a*": {"type": "integer"}, + "a*": {"type": "number"}, "aaa*": {"maximum": 20} } }, + "banFromTopLevel": true, + "note": "Cannot run this schema at the top-level because it is unaware of the _id field. ", + "note_ext": "Instances of 'integer' in this test have been replaced with 'number'.", "tests": [ { "description": "a single valid match is valid", diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/properties.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/properties.json index a830c67e7b3..fb40facf548 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/properties.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/properties.json @@ -1,9 +1,10 @@ [ { "description": "object properties validation", + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "schema": { "properties": { - "foo": {"type": "integer"}, + "foo": {"type": "number"}, "bar": {"type": "string"} } }, @@ -49,8 +50,10 @@ "bar": {"type": "array"} }, "patternProperties": {"f.o": {"minItems": 2}}, - "additionalProperties": {"type": "integer"} + "additionalProperties": {"type": "number"} }, + "banFromTopLevel": true, + "note": "Cannot run this schema at the top-level because it is unaware of the _id field.", "tests": [ { "description": "property validates property", diff --git a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/type.json b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/type.json index 61293740df7..2298cee6c3a 100644 --- a/src/third_party/JSON-Schema-Test-Suite/tests/draft4/type.json +++ b/src/third_party/JSON-Schema-Test-Suite/tests/draft4/type.json @@ -1,51 +1,5 @@ [ { - "description": "integer type matches integers", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "an integer is an integer", - "data": 1, - "valid": true - }, - { - "description": "a float is not an integer", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an integer", - "data": "foo", - "valid": false - }, - { - "description": "a string is still not an integer, even if it looks like one", - "data": "1", - "valid": false - }, - { - "description": "an object is not an integer", - "data": {}, - "valid": false - }, - { - "description": "an array is not an integer", - "data": [], - "valid": false - }, - { - "description": "a boolean is not an integer", - "data": true, - "valid": false - }, - { - "description": "null is not an integer", - "data": null, - "valid": false - } - ] - }, - { "description": "number type matches numbers", "schema": {"type": "number"}, "tests": [ @@ -303,7 +257,8 @@ }, { "description": "multiple types can be specified in an array", - "schema": {"type": ["integer", "string"]}, + "schema": {"type": ["number", "string"]}, + "note": "Instances of 'integer' in this test have been replaced with 'number'.", "tests": [ { "description": "an integer is valid", @@ -316,9 +271,9 @@ "valid": true }, { - "description": "a float is invalid", + "description": "a float is valid", "data": 1.1, - "valid": false + "valid": true }, { "description": "an object is invalid", |