diff options
Diffstat (limited to 'tests/draft2019-09/optional/format')
18 files changed, 547 insertions, 17 deletions
diff --git a/tests/draft2019-09/optional/format/date-time.json b/tests/draft2019-09/optional/format/date-time.json index 5f911ef..119179c 100644 --- a/tests/draft2019-09/optional/format/date-time.json +++ b/tests/draft2019-09/optional/format/date-time.json @@ -1,9 +1,39 @@ [ { "description": "validation of date-time strings", - "schema": {"format": "date-time"}, + "schema": { "format": "date-time" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid date-time string", "data": "1963-06-19T08:30:06.283185Z", "valid": true @@ -34,6 +64,11 @@ "valid": false }, { + "description": "an invalid closing Z after time-zone offset", + "data": "1963-06-19T08:30:06.28123+01:00Z", + "valid": false + }, + { "description": "an invalid date-time string", "data": "06/19/1963 08:30:06 PST", "valid": false diff --git a/tests/draft2019-09/optional/format/date.json b/tests/draft2019-09/optional/format/date.json index 6cc2feb..b4f61ee 100644 --- a/tests/draft2019-09/optional/format/date.json +++ b/tests/draft2019-09/optional/format/date.json @@ -1,9 +1,39 @@ [ { "description": "validation of date strings", - "schema": {"format": "date"}, + "schema": { "format": "date" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid date string", "data": "1963-06-19", "valid": true diff --git a/tests/draft2019-09/optional/format/duration.json b/tests/draft2019-09/optional/format/duration.json index eb33dbb..741348a 100644 --- a/tests/draft2019-09/optional/format/duration.json +++ b/tests/draft2019-09/optional/format/duration.json @@ -1,9 +1,39 @@ [ { "description": "validation of duration strings", - "schema": {"format": "duration"}, + "schema": { "format": "duration" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid duration string", "data": "P4DT12H30M5S", "valid": true diff --git a/tests/draft2019-09/optional/format/email.json b/tests/draft2019-09/optional/format/email.json index 02396d2..d6761a4 100644 --- a/tests/draft2019-09/optional/format/email.json +++ b/tests/draft2019-09/optional/format/email.json @@ -1,9 +1,39 @@ [ { "description": "validation of e-mail addresses", - "schema": {"format": "email"}, + "schema": { "format": "email" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true diff --git a/tests/draft2019-09/optional/format/hostname.json b/tests/draft2019-09/optional/format/hostname.json index 476541a..8a67fda 100644 --- a/tests/draft2019-09/optional/format/hostname.json +++ b/tests/draft2019-09/optional/format/hostname.json @@ -1,9 +1,39 @@ [ { "description": "validation of host names", - "schema": {"format": "hostname"}, + "schema": { "format": "hostname" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid host name", "data": "www.example.com", "valid": true diff --git a/tests/draft2019-09/optional/format/idn-email.json b/tests/draft2019-09/optional/format/idn-email.json index 552d106..6e21374 100644 --- a/tests/draft2019-09/optional/format/idn-email.json +++ b/tests/draft2019-09/optional/format/idn-email.json @@ -1,9 +1,39 @@ [ { "description": "validation of an internationalized e-mail addresses", - "schema": {"format": "idn-email"}, + "schema": { "format": "idn-email" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid idn e-mail (example@example.test in Hangul)", "data": "실례@실례.테스트", "valid": true diff --git a/tests/draft2019-09/optional/format/idn-hostname.json b/tests/draft2019-09/optional/format/idn-hostname.json index bbb257b..6c8f86a 100644 --- a/tests/draft2019-09/optional/format/idn-hostname.json +++ b/tests/draft2019-09/optional/format/idn-hostname.json @@ -4,6 +4,36 @@ "schema": { "format": "idn-hostname" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid host name (example.test in Hangul)", "data": "실례.테스트", "valid": true diff --git a/tests/draft2019-09/optional/format/ipv4.json b/tests/draft2019-09/optional/format/ipv4.json index 4d10927..6b166c7 100644 --- a/tests/draft2019-09/optional/format/ipv4.json +++ b/tests/draft2019-09/optional/format/ipv4.json @@ -1,9 +1,39 @@ [ { "description": "validation of IP addresses", - "schema": {"format": "ipv4"}, + "schema": { "format": "ipv4" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid IP address", "data": "192.168.0.1", "valid": true diff --git a/tests/draft2019-09/optional/format/ipv6.json b/tests/draft2019-09/optional/format/ipv6.json index cf629c6..6379927 100644 --- a/tests/draft2019-09/optional/format/ipv6.json +++ b/tests/draft2019-09/optional/format/ipv6.json @@ -1,9 +1,39 @@ [ { "description": "validation of IPv6 addresses", - "schema": {"format": "ipv6"}, + "schema": { "format": "ipv6" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid IPv6 address", "data": "::1", "valid": true @@ -14,6 +44,16 @@ "valid": false }, { + "description": "trailing 4 hex symbols is valid", + "data": "::abef", + "valid": true + }, + { + "description": "trailing 5 hex symbols is invalid", + "data": "::abcef", + "valid": false + }, + { "description": "an IPv6 address with too many components", "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", "valid": false @@ -54,6 +94,11 @@ "valid": false }, { + "description": "single set of double colons in the middle is valid", + "data": "1:d6::42", + "valid": true + }, + { "description": "two sets of double colons is invalid", "data": "1::d6::42", "valid": false diff --git a/tests/draft2019-09/optional/format/iri-reference.json b/tests/draft2019-09/optional/format/iri-reference.json index 1fd779c..c6b4c22 100644 --- a/tests/draft2019-09/optional/format/iri-reference.json +++ b/tests/draft2019-09/optional/format/iri-reference.json @@ -1,9 +1,39 @@ [ { "description": "validation of IRI References", - "schema": {"format": "iri-reference"}, + "schema": { "format": "iri-reference" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid IRI", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true diff --git a/tests/draft2019-09/optional/format/iri.json b/tests/draft2019-09/optional/format/iri.json index 1414f2e..a0d12ae 100644 --- a/tests/draft2019-09/optional/format/iri.json +++ b/tests/draft2019-09/optional/format/iri.json @@ -1,9 +1,39 @@ [ { "description": "validation of IRIs", - "schema": {"format": "iri"}, + "schema": { "format": "iri" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid IRI with anchor tag", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true diff --git a/tests/draft2019-09/optional/format/json-pointer.json b/tests/draft2019-09/optional/format/json-pointer.json index 65c2f06..a0346b5 100644 --- a/tests/draft2019-09/optional/format/json-pointer.json +++ b/tests/draft2019-09/optional/format/json-pointer.json @@ -1,9 +1,39 @@ [ { "description": "validation of JSON-pointers (JSON String Representation)", - "schema": {"format": "json-pointer"}, + "schema": { "format": "json-pointer" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid JSON-pointer", "data": "/foo/bar~0/baz~1/%a", "valid": true diff --git a/tests/draft2019-09/optional/format/regex.json b/tests/draft2019-09/optional/format/regex.json index d99d021..3449177 100644 --- a/tests/draft2019-09/optional/format/regex.json +++ b/tests/draft2019-09/optional/format/regex.json @@ -1,9 +1,39 @@ [ { "description": "validation of regular expressions", - "schema": {"format": "regex"}, + "schema": { "format": "regex" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid regular expression", "data": "([abc])+\\s+$", "valid": true diff --git a/tests/draft2019-09/optional/format/relative-json-pointer.json b/tests/draft2019-09/optional/format/relative-json-pointer.json index 22fb14e..9309986 100644 --- a/tests/draft2019-09/optional/format/relative-json-pointer.json +++ b/tests/draft2019-09/optional/format/relative-json-pointer.json @@ -1,9 +1,39 @@ [ { "description": "validation of Relative JSON Pointers (RJP)", - "schema": {"format": "relative-json-pointer"}, + "schema": { "format": "relative-json-pointer" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid upwards RJP", "data": "1", "valid": true diff --git a/tests/draft2019-09/optional/format/time.json b/tests/draft2019-09/optional/format/time.json index 0a8da0e..5011d78 100644 --- a/tests/draft2019-09/optional/format/time.json +++ b/tests/draft2019-09/optional/format/time.json @@ -1,9 +1,39 @@ [ { "description": "validation of time strings", - "schema": {"format": "time"}, + "schema": { "format": "time" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid time string", "data": "08:30:06Z", "valid": true diff --git a/tests/draft2019-09/optional/format/uri-reference.json b/tests/draft2019-09/optional/format/uri-reference.json index e4c9eef..7cdf228 100644 --- a/tests/draft2019-09/optional/format/uri-reference.json +++ b/tests/draft2019-09/optional/format/uri-reference.json @@ -1,9 +1,39 @@ [ { "description": "validation of URI References", - "schema": {"format": "uri-reference"}, + "schema": { "format": "uri-reference" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid URI", "data": "http://foo.bar/?baz=qux#quux", "valid": true diff --git a/tests/draft2019-09/optional/format/uri-template.json b/tests/draft2019-09/optional/format/uri-template.json index 33ab76e..df355c5 100644 --- a/tests/draft2019-09/optional/format/uri-template.json +++ b/tests/draft2019-09/optional/format/uri-template.json @@ -1,9 +1,39 @@ [ { "description": "format: uri-template", - "schema": {"format": "uri-template"}, + "schema": { "format": "uri-template" }, "tests": [ { + "description": "all string formats ignore integers", + "data": 12, + "valid": true + }, + { + "description": "all string formats ignore floats", + "data": 13.7, + "valid": true + }, + { + "description": "all string formats ignore objects", + "data": {}, + "valid": true + }, + { + "description": "all string formats ignore arrays", + "data": [], + "valid": true + }, + { + "description": "all string formats ignore booleans", + "data": false, + "valid": true + }, + { + "description": "all string formats ignore nulls", + "data": null, + "valid": true + }, + { "description": "a valid uri-template", "data": "http://example.com/dictionary/{term:1}/{term}", "valid": true diff --git a/tests/draft2019-09/optional/format/uri.json b/tests/draft2019-09/optional/format/uri.json index 58d3085..792d71a 100644 --- a/tests/draft2019-09/optional/format/uri.json +++ b/tests/draft2019-09/optional/format/uri.json @@ -1,7 +1,7 @@ [ { "description": "validation of URIs", - "schema": {"format": "uri"}, + "schema": { "format": "uri" }, "tests": [ { "description": "a valid URL with anchor tag", |