summaryrefslogtreecommitdiffstats
path: root/src/rapidjson/bin/jsonschema/tests/draft3/required.json
diff options
context:
space:
mode:
Diffstat (limited to 'src/rapidjson/bin/jsonschema/tests/draft3/required.json')
-rw-r--r--src/rapidjson/bin/jsonschema/tests/draft3/required.json53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/rapidjson/bin/jsonschema/tests/draft3/required.json b/src/rapidjson/bin/jsonschema/tests/draft3/required.json
new file mode 100644
index 000000000..aaaf02427
--- /dev/null
+++ b/src/rapidjson/bin/jsonschema/tests/draft3/required.json
@@ -0,0 +1,53 @@
+[
+ {
+ "description": "required validation",
+ "schema": {
+ "properties": {
+ "foo": {"required" : true},
+ "bar": {}
+ }
+ },
+ "tests": [
+ {
+ "description": "present required property is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "non-present required property is invalid",
+ "data": {"bar": 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "required default validation",
+ "schema": {
+ "properties": {
+ "foo": {}
+ }
+ },
+ "tests": [
+ {
+ "description": "not required by default",
+ "data": {},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "required explicitly false validation",
+ "schema": {
+ "properties": {
+ "foo": {"required": false}
+ }
+ },
+ "tests": [
+ {
+ "description": "not required if required is false",
+ "data": {},
+ "valid": true
+ }
+ ]
+ }
+]