summaryrefslogtreecommitdiffstats
path: root/contrib/libucl/tests/schema/oneOf.json
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2014-03-22 17:28:14 +0000
committerbapt <bapt@FreeBSD.org>2014-03-22 17:28:14 +0000
commitb471b8e16d6f2c205ae497402bad0a60c9cd6fa8 (patch)
treeaabc973b2e4479277f8fe9aa0e8ed539826fdca3 /contrib/libucl/tests/schema/oneOf.json
parent841158cbfbfc6b699dbc10892c6cb878a66a5d7e (diff)
parent6b4d859b54b28a9d46c317ff21676aa37241f6de (diff)
downloadFreeBSD-src-b471b8e16d6f2c205ae497402bad0a60c9cd6fa8.zip
FreeBSD-src-b471b8e16d6f2c205ae497402bad0a60c9cd6fa8.tar.gz
Update to 20140321
This brings schema validation MFC after: 1 week
Diffstat (limited to 'contrib/libucl/tests/schema/oneOf.json')
-rw-r--r--contrib/libucl/tests/schema/oneOf.json68
1 files changed, 68 insertions, 0 deletions
diff --git a/contrib/libucl/tests/schema/oneOf.json b/contrib/libucl/tests/schema/oneOf.json
new file mode 100644
index 0000000..1eaa4e4
--- /dev/null
+++ b/contrib/libucl/tests/schema/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
+ }
+ ]
+ }
+]
OpenPOWER on IntegriCloud