summaryrefslogtreecommitdiff
path: root/tests/draft-future/default.json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2021-06-24 11:18:28 +0200
committerJulian Berman <Julian@GrayVines.com>2021-06-24 11:18:28 +0200
commit6d455c83e3fd953a9e762e596c52ce1fc4bf8740 (patch)
tree72b0efdf6215d1f0a90a1d2ce5d6c3f5ec5aba0d /tests/draft-future/default.json
parentc19f0b4ee66ce10217185fa8d2c8b7a2784e3a31 (diff)
downloadjsonschema-6d455c83e3fd953a9e762e596c52ce1fc4bf8740.tar.gz
Squashed 'json/' changes from 09fd353f..0aefbb3d
0aefbb3d Merge pull request #491 from jdesrosiers/object-contains-tests 336ef8d2 Merge pull request #452 from LeifRilbe/rilbe/propertyNames-with-pattern 2dfbc79c Simplify the test case names as well. b6d0649d Add tests for contains with objects da687ca5 Enforce a consistent code style for contains tests b163efcf Merge pull request #490 from jdesrosiers/draft-future 7c8cb488 Initialize draft-future with 2020-12 tests 4d65d2df Merge pull request #483 from kylef/kylef/date ee9dcaa7 Merge pull request #485 from marksparkza/contains-with-false-if eaa5bffc Merge pull request #489 from json-schema-org/ether/more-recursiveRef 7c33b533 dynamic $recursiveRef test with cousin $recursiveAnchors 8a3a542b Fix invalid JSON error 8a89f58e Add tests combining remote refs and defs 3aec0d14 Add tests combining relative refs and defs a107d196 fix: $defs -> definitions in draft 6,7 tests 0c223de2 Remove a test for undefined $id behavior 4efec180 Test that "contains" does not fail due to false "if" subschema bf383b4c fix: make identifiers unique across tests 812f1f08 Merge pull request #484 from json-schema-org/ether/schemas-under-unknown-keywords 64f6b850 Test that identifiers are not found inside unrecognized keywords c69a89c6 Stricter date format constraints 93193442 Test cases for propertyNames with pattern - update after PR feedback. 8e4aad95 Test cases for propertyNames with pattern. git-subtree-dir: json git-subtree-split: 0aefbb3d80e0caa22f3782677cf09c61b2205aa7
Diffstat (limited to 'tests/draft-future/default.json')
-rw-r--r--tests/draft-future/default.json79
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/draft-future/default.json b/tests/draft-future/default.json
new file mode 100644
index 0000000..289a9b6
--- /dev/null
+++ b/tests/draft-future/default.json
@@ -0,0 +1,79 @@
+[
+ {
+ "description": "invalid type for default",
+ "schema": {
+ "properties": {
+ "foo": {
+ "type": "integer",
+ "default": []
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"foo": 13},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "invalid string value for default",
+ "schema": {
+ "properties": {
+ "bar": {
+ "type": "string",
+ "minLength": 4,
+ "default": "bad"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"bar": "good"},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "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
+ }
+ ]
+ }
+]