summaryrefslogtreecommitdiff
path: root/json/tests/draft7/default.json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2021-04-28 09:33:03 -0400
committerJulian Berman <Julian@GrayVines.com>2021-04-28 09:33:03 -0400
commit783d81d5ef41ddda7681bd63f6fb7ce05ef3d8d8 (patch)
treecc4bd5ff399308db833c6d74721ebc9bb761e89f /json/tests/draft7/default.json
parenta241799a5a5ffafaa93d6dd9b9cd8762e02525c6 (diff)
parentc19f0b4ee66ce10217185fa8d2c8b7a2784e3a31 (diff)
downloadjsonschema-783d81d5ef41ddda7681bd63f6fb7ce05ef3d8d8.tar.gz
Merge commit 'c19f0b4ee66ce10217185fa8d2c8b7a2784e3a31'
* commit 'c19f0b4ee66ce10217185fa8d2c8b7a2784e3a31': Squashed 'json/' changes from 15ec577f..09fd353f
Diffstat (limited to 'json/tests/draft7/default.json')
-rw-r--r--json/tests/draft7/default.json30
1 files changed, 30 insertions, 0 deletions
diff --git a/json/tests/draft7/default.json b/json/tests/draft7/default.json
index 1762977..289a9b6 100644
--- a/json/tests/draft7/default.json
+++ b/json/tests/draft7/default.json
@@ -45,5 +45,35 @@
"valid": true
}
]
+ },
+ {
+ "description": "the default keyword does not do anything if the property is missing",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "alpha": {
+ "type": "number",
+ "maximum": 3,
+ "default": 5
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "an explicit property value is checked against maximum (passing)",
+ "data": { "alpha": 1 },
+ "valid": true
+ },
+ {
+ "description": "an explicit property value is checked against maximum (failing)",
+ "data": { "alpha": 5 },
+ "valid": false
+ },
+ {
+ "description": "missing properties are not filled in with the default",
+ "data": {},
+ "valid": true
+ }
+ ]
}
]