X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=examples%2Fbiojson-doc%2Ftests%2FanyOf.json;fp=examples%2Fbiojson-doc%2Ftests%2FanyOf.json;h=a58714afd89277abdb180d592a3a38a1465de731;hb=1ba05544b34253204ef6410017a179c31fe5e23d;hp=0000000000000000000000000000000000000000;hpb=f8ce78dc02ce9d96129fcc4882749f43869928ff;p=jalview.git diff --git a/examples/biojson-doc/tests/anyOf.json b/examples/biojson-doc/tests/anyOf.json new file mode 100755 index 0000000..a58714a --- /dev/null +++ b/examples/biojson-doc/tests/anyOf.json @@ -0,0 +1,68 @@ +[ + { + "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", + "anyOf" : [ + { + "maxLength": 2 + }, + { + "minLength": 4 + } + ] + }, + "tests": [ + { + "description": "mismatch base schema", + "data": 3, + "valid": false + }, + { + "description": "one anyOf valid", + "data": "foobar", + "valid": true + }, + { + "description": "both anyOf invalid", + "data": "foo", + "valid": false + } + ] + } +]