summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json')
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json68
1 files changed, 68 insertions, 0 deletions
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json
new file mode 100644
index 00000000000..1eaa4e47949
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json
@@ -0,0 +1,68 @@
+[
+ {
+ "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",
+ "oneOf" : [
+ {
+ "minLength": 2
+ },
+ {
+ "maxLength": 4
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "mismatch base schema",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "one oneOf valid",
+ "data": "foobar",
+ "valid": true
+ },
+ {
+ "description": "both oneOf valid",
+ "data": "foo",
+ "valid": false
+ }
+ ]
+ }
+]