summaryrefslogtreecommitdiff
path: root/json/tests/draft7/if-then-else.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests/draft7/if-then-else.json')
-rw-r--r--json/tests/draft7/if-then-else.json30
1 files changed, 30 insertions, 0 deletions
diff --git a/json/tests/draft7/if-then-else.json b/json/tests/draft7/if-then-else.json
index e0b873e..284e919 100644
--- a/json/tests/draft7/if-then-else.json
+++ b/json/tests/draft7/if-then-else.json
@@ -224,5 +224,35 @@
"valid": true
}
]
+ },
+ {
+ "description": "if appears at the end when serialized (keyword processing sequence)",
+ "schema": {
+ "then": { "const": "yes" },
+ "else": { "const": "other" },
+ "if": { "maxLength": 4 }
+ },
+ "tests": [
+ {
+ "description": "yes redirects to then and passes",
+ "data": "yes",
+ "valid": true
+ },
+ {
+ "description": "other redirects to else and passes",
+ "data": "other",
+ "valid": true
+ },
+ {
+ "description": "no redirects to then and fails",
+ "data": "no",
+ "valid": false
+ },
+ {
+ "description": "invalid redirects to else and fails",
+ "data": "invalid",
+ "valid": false
+ }
+ ]
}
]