Files
jspg/fixtures/format.json
Alex Groleau e026e82f65 test(jspg): rename items fixture to array and resolve unused HashMap warning
- Rename fixtures/items.json to fixtures/array.json to better reflect array testing constraints.
- Update reference paths in src/tests/fixtures.rs and across other fixture JSON files.
- Remove unused HashMap import in src/validator/rules/dict.rs to resolve the compiler warning.
2026-06-23 20:17:03 -04:00

8776 lines
230 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[
{
"description": "validation of date-time strings",
"database": {
"types": [
{
"name": "format_0_0",
"schemas": {
"format_0_0": {
"format": "date-time"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid date-time string",
"data": "1963-06-19T08:30:06.283185Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid date-time string without second fraction",
"data": "1963-06-19T08:30:06Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid date-time string with plus offset",
"data": "1937-01-01T12:00:27.87+00:20",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid date-time string with minus offset",
"data": "1990-12-31T15:59:50.123-08:00",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid date-time with a leap second, UTC",
"data": "1998-12-31T23:59:60Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid date-time with a leap second, with minus offset",
"data": "1998-12-31T15:59:60.123-08:00",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid date-time past leap second, UTC",
"data": "1998-12-31T23:59:61Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date-time",
"error": "invalid time element: hour/min/sec out of range"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "an invalid date-time with leap second on a wrong minute, UTC",
"data": "1998-12-31T23:58:60Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date-time",
"error": "invalid time element: invalid leap second"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "an invalid date-time with leap second on a wrong hour, UTC",
"data": "1998-12-31T22:59:60Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date-time",
"error": "invalid time element: invalid leap second"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "an invalid day in date-time string",
"data": "1990-02-31T15:59:59.123-08:00",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid date element: february has 28 days only",
"format": "date-time"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "an invalid offset in date-time string",
"data": "1990-12-31T15:59:59-24:00",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date-time",
"error": "invalid time element: hour/min in offset out of range"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "an invalid closing Z after time-zone offset",
"data": "1963-06-19T08:30:06.28123+01:00Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid time element: offset must be 6 characters long",
"format": "date-time"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "an invalid date-time string",
"data": "06/19/1963 08:30:06 PST",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "11th character must be t or T",
"format": "date-time"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "case-insensitive T and Z",
"data": "1963-06-19t08:30:06.283185z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "only RFC3339 not all of ISO 8601 are valid",
"data": "2013-350T01:01:01",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "less than 20 characters long",
"format": "date-time"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "invalid non-padded month dates",
"data": "1963-6-19T08:30:06.283185Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date-time",
"error": "11th character must be t or T"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "invalid non-padded day dates",
"data": "1963-06-1T08:30:06.283185Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "11th character must be t or T",
"format": "date-time"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "invalid non-ASCII '' (a Bengali 4) in date portion",
"data": "1963-06-1T00:00:00Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date-time",
"error": "11th character must be t or T"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "invalid non-ASCII '' (a Bengali 4) in time portion",
"data": "1963-06-11T0:00:00Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date-time",
"error": "invalid time element: missing colon in correct place"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
},
{
"description": "invalid extended year",
"data": "+11963-06-19T08:30:06.283185Z",
"schema_id": "format_0_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "11th character must be t or T",
"format": "date-time"
},
"details": {
"path": "",
"schema": "format_0_0"
}
}
]
}
}
]
},
{
"description": "validation of date strings",
"database": {
"types": [
{
"name": "format_1_0",
"schemas": {
"format_1_0": {
"format": "date"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid date string",
"data": "1963-06-19",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid date string with 31 days in January",
"data": "2020-01-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 32 days in January",
"data": "2020-01-32",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "32 days in month"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 28 days in February (normal)",
"data": "2021-02-28",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 29 days in February (normal)",
"data": "2021-02-29",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "february has 28 days only"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 29 days in February (leap)",
"data": "2020-02-29",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 30 days in February (leap)",
"data": "2020-02-30",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "february has 29 days only",
"format": "date"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 31 days in March",
"data": "2020-03-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 32 days in March",
"data": "2020-03-32",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "32 days in month"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 30 days in April",
"data": "2020-04-30",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 31 days in April",
"data": "2020-04-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "month has 30 days only",
"format": "date"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 31 days in May",
"data": "2020-05-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 32 days in May",
"data": "2020-05-32",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "32 days in month"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 30 days in June",
"data": "2020-06-30",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 31 days in June",
"data": "2020-06-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "month has 30 days only"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 31 days in July",
"data": "2020-07-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 32 days in July",
"data": "2020-07-32",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "32 days in month",
"format": "date"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 31 days in August",
"data": "2020-08-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 32 days in August",
"data": "2020-08-32",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "32 days in month"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 30 days in September",
"data": "2020-09-30",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 31 days in September",
"data": "2020-09-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "month has 30 days only"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 31 days in October",
"data": "2020-10-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 32 days in October",
"data": "2020-10-32",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "32 days in month"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 30 days in November",
"data": "2020-11-30",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 31 days in November",
"data": "2020-11-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "month has 30 days only"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a valid date string with 31 days in December",
"data": "2020-12-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a invalid date string with 32 days in December",
"data": "2020-12-32",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "32 days in month"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "a invalid date string with invalid month",
"data": "2020-13-01",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "13 months in year",
"format": "date"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "an invalid date string",
"data": "06/19/1963",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "missing hyphen in correct place"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "only RFC3339 not all of ISO 8601 are valid",
"data": "2013-350",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "must be 10 characters long"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "non-padded month dates are not valid",
"data": "1998-1-20",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "must be 10 characters long"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "non-padded day dates are not valid",
"data": "1998-01-1",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "must be 10 characters long"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "invalid month",
"data": "1998-13-01",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "13 months in year",
"format": "date"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "invalid month-day combination",
"data": "1998-04-31",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "month has 30 days only"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "2021 is not a leap year",
"data": "2021-02-29",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "february has 28 days only"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "2020 is a leap year",
"data": "2020-02-29",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "invalid non-ASCII '' (a Bengali 4)",
"data": "1963-06-1",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "must be 10 characters long"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "ISO8601 / non-RFC3339: YYYYMMDD without dashes (2023-03-28)",
"data": "20230328",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "must be 10 characters long"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "ISO8601 / non-RFC3339: week number implicit day of week (2023-01-02)",
"data": "2023-W01",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "must be 10 characters long",
"format": "date"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "ISO8601 / non-RFC3339: week number with day of week (2023-03-28)",
"data": "2023-W13-2",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "missing hyphen in correct place"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "ISO8601 / non-RFC3339: week number rollover to next year (2023-01-01)",
"data": "2022W527",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "must be 10 characters long"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
},
{
"description": "an invalid time string in date-time format",
"data": "2020-11-28T23:55:45Z",
"schema_id": "format_1_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "date",
"error": "must be 10 characters long"
},
"details": {
"path": "",
"schema": "format_1_0"
}
}
]
}
}
]
},
{
"description": "validation of duration strings",
"database": {
"types": [
{
"name": "format_2_0",
"schemas": {
"format_2_0": {
"format": "duration"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid duration string",
"data": "P4DT12H30M5S",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid duration string",
"data": "PT1D",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid unit D",
"format": "duration"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "must start with P",
"data": "4DT12H30M5S",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "duration",
"error": "must start with P"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "no elements present",
"data": "P",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "nothing after P",
"format": "duration"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "no time elements present",
"data": "P1YT",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "duration",
"error": "no time elements"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "no date or time elements present",
"data": "PT",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "no time elements",
"format": "duration"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "elements out of order",
"data": "P2D1Y",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "duration",
"error": "unit Y out of order"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "missing time separator",
"data": "P1D2H",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "duration",
"error": "invalid unit H"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "time element in the date position",
"data": "P2S",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "duration",
"error": "invalid unit S"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "four years duration",
"data": "P4Y",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "zero time, in seconds",
"data": "PT0S",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "zero time, in days",
"data": "P0D",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "one month duration",
"data": "P1M",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "one minute duration",
"data": "PT1M",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "one and a half days, in hours",
"data": "PT36H",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "one and a half days, in days and hours",
"data": "P1DT12H",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "two weeks",
"data": "P2W",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "weeks cannot be combined with other units",
"data": "P1Y2W",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid week",
"format": "duration"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "P২Y",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "missing number",
"format": "duration"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
},
{
"description": "element without unit",
"data": "P1",
"schema_id": "format_2_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "missing unit",
"format": "duration"
},
"details": {
"path": "",
"schema": "format_2_0"
}
}
]
}
}
]
},
{
"description": "\\a is not an ECMA 262 control escape",
"database": {
"types": [
{
"name": "format_3_0",
"schemas": {
"format_3_0": {
"format": "regex"
}
}
}
]
},
"tests": [
{
"description": "when used as a pattern",
"data": "\\a",
"schema_id": "format_3_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "validation of e-mail addresses",
"database": {
"types": [
{
"name": "format_4_0",
"schemas": {
"format_4_0": {
"format": "email"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid e-mail address",
"data": "joe.bloggs@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid e-mail address",
"data": "2962",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "missing @",
"format": "email"
},
"details": {
"path": "",
"schema": "format_4_0"
}
}
]
}
},
{
"description": "tilde in local part is valid",
"data": "te~st@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "tilde before local part is valid",
"data": "~test@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "tilde after local part is valid",
"data": "test~@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a quoted string with a space in the local part is valid",
"data": "\"joe bloggs\"@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a quoted string with a double dot in the local part is valid",
"data": "\"joe..bloggs\"@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a quoted string with a @ in the local part is valid",
"data": "\"joe@bloggs\"@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an IPv4-address-literal after the @ is valid",
"data": "joe.bloggs@[127.0.0.1]",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an IPv6-address-literal after the @ is valid",
"data": "joe.bloggs@[IPv6:::1]",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "dot before local part is not valid",
"data": ".test@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "starts with dot",
"format": "email"
},
"details": {
"path": "",
"schema": "format_4_0"
}
}
]
}
},
{
"description": "dot after local part is not valid",
"data": "test.@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "email",
"error": "ends with dot"
},
"details": {
"path": "",
"schema": "format_4_0"
}
}
]
}
},
{
"description": "two separated dots inside local part are valid",
"data": "te.s.t@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "two subsequent dots inside local part are not valid",
"data": "te..st@example.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "email",
"error": "consecutive dots"
},
"details": {
"path": "",
"schema": "format_4_0"
}
}
]
}
},
{
"description": "an invalid domain",
"data": "joe.bloggs@invalid=domain.com",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid domain: invalid character '='",
"format": "email"
},
"details": {
"path": "",
"schema": "format_4_0"
}
}
]
}
},
{
"description": "an invalid IPv4-address-literal",
"data": "joe.bloggs@[127.0.0.300]",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "email",
"error": "invalid ipv4 address: invalid IPv4 address syntax"
},
"details": {
"path": "",
"schema": "format_4_0"
}
}
]
}
},
{
"description": "two email addresses is not valid",
"data": "user1@oceania.org, user2@oceania.org",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "email",
"error": "invalid character '@'"
},
"details": {
"path": "",
"schema": "format_4_0"
}
}
]
}
},
{
"description": "full \"From\" header is invalid",
"data": "\"Winston Smith\" <winston.smith@recdep.minitrue> (Records Department)",
"schema_id": "format_4_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "email",
"error": "invalid character '\"'"
},
"details": {
"path": "",
"schema": "format_4_0"
}
}
]
}
}
]
},
{
"description": "validation of host names",
"database": {
"types": [
{
"name": "format_5_0",
"schemas": {
"format_5_0": {
"format": "hostname"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid host name",
"data": "www.example.com",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single label",
"data": "hostname",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single label with digits",
"data": "h0stn4me",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single label starting with digit",
"data": "1host",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single label ending with digit",
"data": "hostnam3",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "empty string",
"data": "",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single dot",
"data": ".",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "label must be 1 to 63 characters long",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
},
{
"description": "leading dot",
"data": ".example",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "label must be 1 to 63 characters long"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
},
{
"description": "trailing dot",
"data": "example.",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "label must be 1 to 63 characters long"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
},
{
"description": "IDN label separator",
"data": "examplecom",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid character ''"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
},
{
"description": "single label with hyphen",
"data": "host-name",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "starts with hyphen",
"data": "-hostname",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "label starts with hyphen"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
},
{
"description": "ends with hyphen",
"data": "hostname-",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "label ends with hyphen"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
},
{
"description": "contains \"--\" in the 3rd and 4th position",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
"data": "XN--aa---o47jg78q",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "label has -- in 3rd/4th position but does not start with xn--"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
},
{
"description": "contains underscore",
"data": "host_name",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid character '_'",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
},
{
"description": "exceeds maximum overall length (256)",
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "more than 253 characters long",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
},
{
"description": "maximum label length (63)",
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "exceeds maximum label length (63)",
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
"schema_id": "format_5_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "label must be 1 to 63 characters long"
},
"details": {
"path": "",
"schema": "format_5_0"
}
}
]
}
}
]
},
{
"description": "validation of A-label (punycode) host names",
"database": {
"types": [
{
"name": "format_6_0",
"schemas": {
"format_6_0": {
"format": "hostname"
}
}
}
]
},
"tests": [
{
"description": "invalid Punycode",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
"data": "xn--X",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "a valid host name (example.test in Hangul)",
"data": "xn--9n2bp8q.xn--9t4b11yi5a",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "contains illegal char U+302E Hangul single dot tone mark",
"data": "xn--07jt112bpxg.xn--9t4b11yi5a",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode/IDN: contains disallowed character",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Begins with a Spacing Combining Mark",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
"data": "xn--hello-txk",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Begins with a Nonspacing Mark",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
"data": "xn--hello-zed",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Begins with an Enclosing Mark",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
"data": "xn--hello-6bf",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Exceptions that are PVALID, left-to-right chars",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
"data": "xn--zca29lwxobi7a",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Exceptions that are PVALID, right-to-left chars",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
"data": "xn--qmbc",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Exceptions that are DISALLOWED, right-to-left chars",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
"data": "xn--chb89f",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode/IDN: contains disallowed character",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Exceptions that are DISALLOWED, left-to-right chars",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6 Note: The two combining marks (U+302E and U+302F) are in the middle and not at the start",
"data": "xn--07jceefgh4c",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode/IDN: contains disallowed character",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with no preceding 'l'",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "xn--al-0ea",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with nothing preceding",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "xn--l-fda",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with no following 'l'",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "xn--la-0ea",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with nothing following",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "xn--l-gda",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode/IDN: MIDDLE DOT is allowed between 'l' characters only"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with surrounding 'l's",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "xn--ll-0ea",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Greek KERAIA not followed by Greek",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4",
"data": "xn--S-jib3p",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode/IDN: Greek KERAIA must be followed by Greek character"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Greek KERAIA not followed by anything",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4",
"data": "xn--wva3j",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode/IDN: Greek KERAIA must be followed by Greek character",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Greek KERAIA followed by Greek",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4",
"data": "xn--wva3je",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Hebrew GERESH not preceded by Hebrew",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5",
"data": "xn--A-2hc5h",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Hebrew GERESH not preceded by anything",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5",
"data": "xn--5db1e",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode/IDN: Hebrew GERESH must be preceded by Hebrew character"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Hebrew GERESH preceded by Hebrew",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5",
"data": "xn--4dbc5h",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Hebrew GERSHAYIM not preceded by Hebrew",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6",
"data": "xn--A-2hc8h",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Hebrew GERSHAYIM not preceded by anything",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6",
"data": "xn--5db3e",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode/IDN: Hebrew GERESH must be preceded by Hebrew character"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Hebrew GERSHAYIM preceded by Hebrew",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6",
"data": "xn--4dbc8h",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "KATAKANA MIDDLE DOT with no Hiragana, Katakana, or Han",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "xn--defabc-k64e",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode/IDN: KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "KATAKANA MIDDLE DOT with no other characters",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "xn--vek",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode/IDN: KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "KATAKANA MIDDLE DOT with Hiragana",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "xn--k8j5u",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "KATAKANA MIDDLE DOT with Katakana",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "xn--bck0j",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "KATAKANA MIDDLE DOT with Han",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "xn--vek778f",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Arabic-Indic digits mixed with Extended Arabic-Indic digits",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8",
"data": "xn--ngb6iyr",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "hostname",
"error": "invalid punycode"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "Arabic-Indic digits not mixed with Extended Arabic-Indic digits",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8",
"data": "xn--ngba1o",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Extended Arabic-Indic digits not mixed with Arabic-Indic digits",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.9",
"data": "xn--0-gyc",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "ZERO WIDTH JOINER not preceded by Virama",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf",
"data": "xn--11b2er09f",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "ZERO WIDTH JOINER not preceded by anything",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf",
"data": "xn--02b508i",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid punycode",
"format": "hostname"
},
"details": {
"path": "",
"schema": "format_6_0"
}
}
]
}
},
{
"description": "ZERO WIDTH JOINER preceded by Virama",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf",
"data": "xn--11b2ezcw70k",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "ZERO WIDTH NON-JOINER preceded by Virama",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1",
"data": "xn--11b2ezcs70k",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "ZERO WIDTH NON-JOINER not preceded by Virama but matches regexp",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement",
"data": "xn--ngba5hb2804a",
"schema_id": "format_6_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "validation of an internationalized e-mail addresses",
"database": {
"types": [
{
"name": "format_7_0",
"schemas": {
"format_7_0": {
"format": "idn-email"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid idn e-mail (example@example.test in Hangul)",
"data": "실례@실례.테스트",
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid idn e-mail address",
"data": "2962",
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "missing @",
"format": "idn-email"
},
"details": {
"path": "",
"schema": "format_7_0"
}
}
]
}
},
{
"description": "a valid e-mail address",
"data": "joe.bloggs@example.com",
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid e-mail address",
"data": "2962",
"schema_id": "format_7_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-email",
"error": "missing @"
},
"details": {
"path": "",
"schema": "format_7_0"
}
}
]
}
}
]
},
{
"description": "validation of internationalized host names",
"database": {
"types": [
{
"name": "format_8_0",
"schemas": {
"format_8_0": {
"format": "idn-hostname"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid host name (example.test in Hangul)",
"data": "실례.테스트",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "illegal first char U+302E Hangul single dot tone mark",
"data": "〮실례.테스트",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "contains illegal char U+302E Hangul single dot tone mark",
"data": "실〮례.테스트",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "contains disallowed character"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "a host name with a component too long",
"data": "실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실례례테스트례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례테스트례례실례.테스트",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "invalid label, correct Punycode",
"comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc3492#section-7.1",
"data": "-> $1.00 <--",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "valid Chinese Punycode",
"comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4",
"data": "xn--ihqwcrb4cv8a8dqg056pqjye",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "invalid Punycode",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
"data": "xn--X",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "U-label contains \"--\" in the 3rd and 4th position",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
"data": "XN--aa---o47jg78q",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "U-label starts with a dash",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
"data": "-hello",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "U-label ends with a dash",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
"data": "hello-",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "U-label starts and ends with a dash",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
"data": "-hello-",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Begins with a Spacing Combining Mark",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
"data": "hello",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Begins with a Nonspacing Mark",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
"data": "̀hello",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Begins with an Enclosing Mark",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
"data": "҈hello",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Exceptions that are PVALID, left-to-right chars",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
"data": "ßς་〇",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Exceptions that are PVALID, right-to-left chars",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
"data": "۽۾",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Exceptions that are DISALLOWED, right-to-left chars",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
"data": "ـߺ",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "contains disallowed character"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Exceptions that are DISALLOWED, left-to-right chars",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6 Note: The two combining marks (U+302E and U+302F) are in the middle and not at the start",
"data": "〱〲〳〴〵〮〯〻",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "contains disallowed character",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with no preceding 'l'",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "a·l",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "MIDDLE DOT is allowed between 'l' characters only"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with nothing preceding",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "·l",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "MIDDLE DOT is allowed between 'l' characters only"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with no following 'l'",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "l·a",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "MIDDLE DOT is allowed between 'l' characters only"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with nothing following",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "l·",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "MIDDLE DOT is allowed between 'l' characters only",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "MIDDLE DOT with surrounding 'l's",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
"data": "l·l",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Greek KERAIA not followed by Greek",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4",
"data": "α͵S",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "Greek KERAIA must be followed by Greek character"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Greek KERAIA not followed by anything",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4",
"data": "α͵",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "Greek KERAIA must be followed by Greek character",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Greek KERAIA followed by Greek",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4",
"data": "α͵β",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Hebrew GERESH not preceded by Hebrew",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5",
"data": "A׳ב",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Hebrew GERESH not preceded by anything",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5",
"data": "׳ב",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "Hebrew GERESH must be preceded by Hebrew character",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Hebrew GERESH preceded by Hebrew",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5",
"data": "א׳ב",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Hebrew GERSHAYIM not preceded by Hebrew",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6",
"data": "A״ב",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Hebrew GERSHAYIM not preceded by anything",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6",
"data": "״ב",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "Hebrew GERESH must be preceded by Hebrew character",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Hebrew GERSHAYIM preceded by Hebrew",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6",
"data": "א״ב",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "KATAKANA MIDDLE DOT with no Hiragana, Katakana, or Han",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "def・abc",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "KATAKANA MIDDLE DOT with no other characters",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "・",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "KATAKANA MIDDLE DOT must be with Hiragana, Katakana, or Han"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "KATAKANA MIDDLE DOT with Hiragana",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "・ぁ",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "KATAKANA MIDDLE DOT with Katakana",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "・ァ",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "KATAKANA MIDDLE DOT with Han",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
"data": "・丈",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Arabic-Indic digits mixed with Extended Arabic-Indic digits",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8",
"data": "ب٠۰",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "Arabic-Indic digits not mixed with Extended Arabic-Indic digits",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8",
"data": "ب٠ب",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "Extended Arabic-Indic digits not mixed with Arabic-Indic digits",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.9",
"data": "۰0",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "ZERO WIDTH JOINER not preceded by Virama",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf",
"data": "क‍ष",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "ZERO WIDTH JOINER not preceded by anything",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf",
"data": "‍ष",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_8_0"
}
}
]
}
},
{
"description": "ZERO WIDTH JOINER preceded by Virama",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf",
"data": "क्‍ष",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "ZERO WIDTH NON-JOINER preceded by Virama",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1",
"data": "क्‌ष",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "ZERO WIDTH NON-JOINER not preceded by Virama but matches regexp",
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement",
"data": "بي‌بي",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single label",
"data": "hostname",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single label with hyphen",
"data": "host-name",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single label with digits",
"data": "h0stn4me",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single label starting with digit",
"data": "1host",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "single label ending with digit",
"data": "hostnam3",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "empty string",
"data": "",
"schema_id": "format_8_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "validation of separators in internationalized host names",
"specification": [
{
"rfc3490": "3.1",
"quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"
}
],
"database": {
"types": [
{
"name": "format_9_0",
"schemas": {
"format_9_0": {
"format": "idn-hostname"
}
}
}
]
},
"tests": [
{
"description": "single dot",
"data": ".",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "single ideographic full stop",
"data": "。",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "single fullwidth full stop",
"data": "",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "single halfwidth ideographic full stop",
"data": "。",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "dot as label separator",
"data": "a.b",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "ideographic full stop as label separator",
"data": "a。b",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "fullwidth full stop as label separator",
"data": "ab",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "halfwidth ideographic full stop as label separator",
"data": "a。b",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "leading dot",
"data": ".example",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "leading ideographic full stop",
"data": "。example",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "leading fullwidth full stop",
"data": "example",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "leading halfwidth ideographic full stop",
"data": "。example",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "trailing dot",
"data": "example.",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "trailing ideographic full stop",
"data": "example。",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "trailing fullwidth full stop",
"data": "example",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "idn-hostname",
"error": "idna error: Errors"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "trailing halfwidth ideographic full stop",
"data": "example。",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "idna error: Errors",
"format": "idn-hostname"
},
"details": {
"path": "",
"schema": "format_9_0"
}
}
]
}
},
{
"description": "label too long if separator ignored (full stop)",
"data": "παράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπα.com",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "label too long if separator ignored (ideographic full stop)",
"data": αράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπα。com",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "label too long if separator ignored (fullwidth full stop)",
"data": αράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπαcom",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "label too long if separator ignored (halfwidth ideographic full stop)",
"data": αράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπαράδειγμαπα。com",
"schema_id": "format_9_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "validation of IP addresses",
"database": {
"types": [
{
"name": "format_10_0",
"schemas": {
"format_10_0": {
"format": "ipv4"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid IP address",
"data": "192.168.0.1",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an IP address with too many components",
"data": "127.0.0.0.1",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv4",
"error": "invalid IPv4 address syntax"
},
"details": {
"path": "",
"schema": "format_10_0"
}
}
]
}
},
{
"description": "an IP address with out-of-range values",
"data": "256.256.256.256",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv4 address syntax",
"format": "ipv4"
},
"details": {
"path": "",
"schema": "format_10_0"
}
}
]
}
},
{
"description": "an IP address without 4 components",
"data": "127.0",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv4 address syntax",
"format": "ipv4"
},
"details": {
"path": "",
"schema": "format_10_0"
}
}
]
}
},
{
"description": "an IP address as an integer",
"data": "0x7f000001",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv4",
"error": "invalid IPv4 address syntax"
},
"details": {
"path": "",
"schema": "format_10_0"
}
}
]
}
},
{
"description": "an IP address as an integer (decimal)",
"data": "2130706433",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv4 address syntax",
"format": "ipv4"
},
"details": {
"path": "",
"schema": "format_10_0"
}
}
]
}
},
{
"description": "invalid leading zeroes, as they are treated as octals",
"comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/",
"data": "087.10.0.1",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv4 address syntax",
"format": "ipv4"
},
"details": {
"path": "",
"schema": "format_10_0"
}
}
]
}
},
{
"description": "value without leading zero is valid",
"data": "87.10.0.1",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২7.0.0.1",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv4",
"error": "invalid IPv4 address syntax"
},
"details": {
"path": "",
"schema": "format_10_0"
}
}
]
}
},
{
"description": "netmask is not a part of ipv4 address",
"data": "192.168.1.0/24",
"schema_id": "format_10_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv4",
"error": "invalid IPv4 address syntax"
},
"details": {
"path": "",
"schema": "format_10_0"
}
}
]
}
}
]
},
{
"description": "validation of IPv6 addresses",
"database": {
"types": [
{
"name": "format_11_0",
"schemas": {
"format_11_0": {
"format": "ipv6"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid IPv6 address",
"data": "::1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an IPv6 address with out-of-range values",
"data": "12345::",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "trailing 4 hex symbols is valid",
"data": "::abef",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "trailing 5 hex symbols is invalid",
"data": "::abcef",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"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",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "an IPv6 address containing illegal characters",
"data": "::laptop",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "no digits is valid",
"data": "::",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "leading colons is valid",
"data": "::42:ff:1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "trailing colons is valid",
"data": "d6::",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "missing leading octet is invalid",
"data": ":2:3:4:5:6:7:8",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "missing trailing octet is invalid",
"data": "1:2:3:4:5:6:7:",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "missing leading octet with omitted octets later",
"data": ":2:3:4::8",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "single set of double colons in the middle is valid",
"data": "1:d6::42",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "two sets of double colons is invalid",
"data": "1::d6::42",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "mixed format with the ipv4 section as decimal octets",
"data": "1::d6:192.168.0.1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "mixed format with double colons between the sections",
"data": "1:2::192.168.0.1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "mixed format with ipv4 section with octet out of range",
"data": "1::2:192.168.256.1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "mixed format with ipv4 section with a hex octet",
"data": "1::2:192.168.ff.1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "mixed format with leading double colons (ipv4-mapped ipv6 address)",
"data": "::ffff:192.168.0.1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "triple colons is invalid",
"data": "1:2:3:4:5:::8",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "8 octets",
"data": "1:2:3:4:5:6:7:8",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "insufficient octets without double colons",
"data": "1:2:3:4:5:6:7",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "no colons is invalid",
"data": "1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "ipv4 is not ipv6",
"data": "127.0.0.1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "ipv4 segment must have 4 octets",
"data": "1:2:3:4:1.2.3",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "leading whitespace is invalid",
"data": " ::1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "trailing whitespace is invalid",
"data": "::1 ",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "netmask is not a part of ipv6 address",
"data": "fe80::/64",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "zone id is not a part of ipv6 address",
"data": "fe80::a%eth1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "a long valid ipv6",
"data": "1000:1000:1000:1000:1000:1000:255.255.255.255",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a long invalid ipv6, below length limit, first",
"data": "100:100:100:100:100:100:255.255.255.255.255",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "a long invalid ipv6, below length limit, second",
"data": "100:100:100:100:100:100:100:255.255.255.255",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "invalid non-ASCII '' (a Bengali 4)",
"data": "1:2:3:4:5:6:7:",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid IPv6 address syntax",
"format": "ipv6"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
},
{
"description": "invalid non-ASCII '' (a Bengali 4) in the IPv4 portion",
"data": "1:2::192.16.0.1",
"schema_id": "format_11_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "ipv6",
"error": "invalid IPv6 address syntax"
},
"details": {
"path": "",
"schema": "format_11_0"
}
}
]
}
}
]
},
{
"description": "validation of IRI References",
"database": {
"types": [
{
"name": "format_12_0",
"schemas": {
"format_12_0": {
"format": "iri-reference"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid IRI",
"data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx",
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid protocol-relative IRI Reference",
"data": "//ƒøø.ßår/?∂éœ=πîx#πîüx",
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid relative IRI Reference",
"data": "/âππ",
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid IRI Reference",
"data": "\\\\WINDOWS\\filëßåré",
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "iri-reference",
"error": "contains \\\\"
},
"details": {
"path": "",
"schema": "format_12_0"
}
}
]
}
},
{
"description": "a valid IRI Reference",
"data": "âππ",
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid IRI fragment",
"data": "#ƒrägmênt",
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid IRI fragment",
"data": "#ƒräg\\mênt",
"schema_id": "format_12_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "iri-reference",
"error": "contains \\\\"
},
"details": {
"path": "",
"schema": "format_12_0"
}
}
]
}
}
]
},
{
"description": "validation of IRIs",
"database": {
"types": [
{
"name": "format_13_0",
"schemas": {
"format_13_0": {
"format": "iri"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid IRI with anchor tag",
"data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx",
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid IRI with anchor tag and parentheses",
"data": "http://ƒøø.com/blah_(wîkïpédiå)_blah#ßité-1",
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid IRI with URL-encoded stuff",
"data": "http://ƒøø.ßår/?q=Test%20URL-encoded%20stuff",
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid IRI with many special characters",
"data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com",
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid IRI based on IPv6",
"data": "http://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]",
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid IRI based on IPv6",
"data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334",
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid port number",
"format": "iri"
},
"details": {
"path": "",
"schema": "format_13_0"
}
}
]
}
},
{
"description": "an invalid relative IRI Reference",
"data": "/abc",
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "relative url",
"format": "iri"
},
"details": {
"path": "",
"schema": "format_13_0"
}
}
]
}
},
{
"description": "an invalid IRI",
"data": "\\\\WINDOWS\\filëßåré",
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "iri",
"error": "relative url"
},
"details": {
"path": "",
"schema": "format_13_0"
}
}
]
}
},
{
"description": "an invalid IRI though valid IRI reference",
"data": "âππ",
"schema_id": "format_13_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "relative url",
"format": "iri"
},
"details": {
"path": "",
"schema": "format_13_0"
}
}
]
}
}
]
},
{
"description": "validation of JSON-pointers (JSON String Representation)",
"database": {
"types": [
{
"name": "format_14_0",
"schemas": {
"format_14_0": {
"format": "json-pointer"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid JSON-pointer",
"data": "/foo/bar~0/baz~1/%a",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "not a valid JSON-pointer (~ not escaped)",
"data": "/foo/bar~",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "~ must be followed by 0 or 1",
"format": "json-pointer"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "valid JSON-pointer with empty segment",
"data": "/foo//bar",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer with the last empty segment",
"data": "/foo/bar/",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #1",
"data": "",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #2",
"data": "/foo",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #3",
"data": "/foo/0",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #4",
"data": "/",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #5",
"data": "/a~1b",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #6",
"data": "/c%d",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #7",
"data": "/e^f",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #8",
"data": "/g|h",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #9",
"data": "/i\\j",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #10",
"data": "/k\"l",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #11",
"data": "/ ",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #12",
"data": "/m~0n",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer used adding to the last array position",
"data": "/foo/-",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer (- used as object member name)",
"data": "/foo/-/bar",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer (multiple escaped characters)",
"data": "/~1~0~0~1~1",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer (escaped with fraction part) #1",
"data": "/~1.1",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid JSON-pointer (escaped with fraction part) #2",
"data": "/~0.1",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "not a valid JSON-pointer (URI Fragment Identifier) #1",
"data": "#",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "json-pointer",
"error": "not starting with slash"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (URI Fragment Identifier) #2",
"data": "#/",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "not starting with slash",
"format": "json-pointer"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (URI Fragment Identifier) #3",
"data": "#a",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "json-pointer",
"error": "not starting with slash"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (some escaped, but not all) #1",
"data": "/~0~",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "json-pointer",
"error": "~ must be followed by 0 or 1"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (some escaped, but not all) #2",
"data": "/~0/~",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "json-pointer",
"error": "~ must be followed by 0 or 1"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (wrong escape character) #1",
"data": "/~2",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "~ must be followed by 0 or 1",
"format": "json-pointer"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (wrong escape character) #2",
"data": "/~-1",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "json-pointer",
"error": "~ must be followed by 0 or 1"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (multiple characters not escaped)",
"data": "/~~",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "~ must be followed by 0 or 1",
"format": "json-pointer"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #1",
"data": "a",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "json-pointer",
"error": "not starting with slash"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #2",
"data": "0",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "not starting with slash",
"format": "json-pointer"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
},
{
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #3",
"data": "a/a",
"schema_id": "format_14_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "not starting with slash",
"format": "json-pointer"
},
"details": {
"path": "",
"schema": "format_14_0"
}
}
]
}
}
]
},
{
"description": "validation of regular expressions",
"database": {
"types": [
{
"name": "format_15_0",
"schemas": {
"format_15_0": {
"format": "regex"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_15_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_15_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_15_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_15_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_15_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_15_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid regular expression",
"data": "([abc])+\\s+$",
"schema_id": "format_15_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a regular expression with unclosed parens is invalid",
"data": "^(abc]",
"schema_id": "format_15_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "validation of Relative JSON Pointers (RJP)",
"database": {
"types": [
{
"name": "format_16_0",
"schemas": {
"format_16_0": {
"format": "relative-json-pointer"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid upwards RJP",
"data": "1",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid downwards RJP",
"data": "0/foo/bar",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid up and then down RJP, with array index",
"data": "2/0/baz/1/zip",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid RJP taking the member or index name",
"data": "0#",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid RJP that is a valid JSON Pointer",
"data": "/foo/bar",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "relative-json-pointer",
"error": "must start with non-negative integer"
},
"details": {
"path": "",
"schema": "format_16_0"
}
}
]
}
},
{
"description": "negative prefix",
"data": "-1/foo/bar",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "must start with non-negative integer",
"format": "relative-json-pointer"
},
"details": {
"path": "",
"schema": "format_16_0"
}
}
]
}
},
{
"description": "explicit positive prefix",
"data": "+1/foo/bar",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "relative-json-pointer",
"error": "must start with non-negative integer"
},
"details": {
"path": "",
"schema": "format_16_0"
}
}
]
}
},
{
"description": "## is not a valid json-pointer",
"data": "0##",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "relative-json-pointer",
"error": "invalid json-pointer element: not starting with slash"
},
"details": {
"path": "",
"schema": "format_16_0"
}
}
]
}
},
{
"description": "zero cannot be followed by other digits, plus json-pointer",
"data": "01/a",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "starts with zero",
"format": "relative-json-pointer"
},
"details": {
"path": "",
"schema": "format_16_0"
}
}
]
}
},
{
"description": "zero cannot be followed by other digits, plus octothorpe",
"data": "01#",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "relative-json-pointer",
"error": "starts with zero"
},
"details": {
"path": "",
"schema": "format_16_0"
}
}
]
}
},
{
"description": "empty string",
"data": "",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "multi-digit integer prefix",
"data": "120/foo/bar",
"schema_id": "format_16_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "validation of time strings",
"database": {
"types": [
{
"name": "format_17_0",
"schemas": {
"format_17_0": {
"format": "time"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid time string",
"data": "08:30:06Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "invalid time string with extra leading zeros",
"data": "008:030:006Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "missing colon in correct place"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "invalid time string with no leading zero for single digit",
"data": "8:3:6Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "less than 9 characters long",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "hour, minute, second must be two digits",
"data": "8:0030:6Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "missing colon in correct place"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "a valid time string with leap second, Zulu",
"data": "23:59:60Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "invalid leap second, Zulu (wrong hour)",
"data": "22:59:60Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "invalid leap second"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "invalid leap second, Zulu (wrong minute)",
"data": "23:58:60Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid leap second",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "valid leap second, zero time-offset",
"data": "23:59:60+00:00",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "invalid leap second, zero time-offset (wrong hour)",
"data": "22:59:60+00:00",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "invalid leap second"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "invalid leap second, zero time-offset (wrong minute)",
"data": "23:58:60+00:00",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "invalid leap second"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "valid leap second, positive time-offset",
"data": "01:29:60+01:30",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid leap second, large positive time-offset",
"data": "23:29:60+23:30",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "invalid leap second, positive time-offset (wrong hour)",
"data": "23:59:60+01:00",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "invalid leap second"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "invalid leap second, positive time-offset (wrong minute)",
"data": "23:59:60+00:30",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "invalid leap second"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "valid leap second, negative time-offset",
"data": "15:59:60-08:00",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid leap second, large negative time-offset",
"data": "00:29:60-23:30",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "invalid leap second, negative time-offset (wrong hour)",
"data": "23:59:60-01:00",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "invalid leap second",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "invalid leap second, negative time-offset (wrong minute)",
"data": "23:59:60-00:30",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "invalid leap second"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "a valid time string with second fraction",
"data": "23:20:50.52Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid time string with precise second fraction",
"data": "08:30:06.283185Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid time string with plus offset",
"data": "08:30:06+00:20",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid time string with minus offset",
"data": "08:30:06-08:00",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "hour, minute in time-offset must be two digits",
"data": "08:30:06-8:000",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "missing colon in offset at correct place",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "a valid time string with case-insensitive Z",
"data": "08:30:06z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid time string with invalid hour",
"data": "24:00:00Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "hour/min/sec out of range",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "an invalid time string with invalid minute",
"data": "00:60:00Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "hour/min/sec out of range"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "an invalid time string with invalid second",
"data": "00:00:61Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "hour/min/sec out of range"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "an invalid time string with invalid leap second (wrong hour)",
"data": "22:59:60Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "invalid leap second"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "an invalid time string with invalid leap second (wrong minute)",
"data": "23:58:60Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "invalid leap second"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "an invalid time string with invalid time numoffset hour",
"data": "01:02:03+24:00",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "hour/min in offset out of range",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "an invalid time string with invalid time numoffset minute",
"data": "01:02:03+00:60",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "hour/min in offset out of range"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "an invalid time string with invalid time with both Z and numoffset",
"data": "01:02:03Z+00:30",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "offset must be 6 characters long",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "an invalid offset indicator",
"data": "08:30:06 PST",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "offset must be 6 characters long",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "only RFC3339 not all of ISO 8601 are valid",
"data": "01:01:01,1111",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "offset must be 6 characters long"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "no time offset",
"data": "12:00:00",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "less than 9 characters long"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "no time offset with second fraction",
"data": "12:00:00.52",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "offset must be 6 characters long",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২:00:00Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "time",
"error": "missing colon in correct place"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "offset not starting with plus or minus",
"data": "08:30:06#00:20",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "offset must begin with plus/minus",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "contains letters",
"data": "ab:cd:ef",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "less than 9 characters long",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
},
{
"description": "an invalid time string in date-time format",
"data": "2020-11-28T23:55:45Z",
"schema_id": "format_17_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "missing colon in correct place",
"format": "time"
},
"details": {
"path": "",
"schema": "format_17_0"
}
}
]
}
}
]
},
{
"description": "unknown format",
"database": {
"types": [
{
"name": "format_18_0",
"schemas": {
"format_18_0": {
"format": "unknown"
}
}
}
]
},
"tests": [
{
"description": "unknown formats ignore integers",
"data": 12,
"schema_id": "format_18_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "unknown formats ignore floats",
"data": 13.7,
"schema_id": "format_18_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "unknown formats ignore objects",
"data": {},
"schema_id": "format_18_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "unknown formats ignore arrays",
"data": [],
"schema_id": "format_18_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "unknown formats ignore booleans",
"data": false,
"schema_id": "format_18_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "unknown formats ignore nulls",
"data": null,
"schema_id": "format_18_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "unknown formats ignore strings",
"data": "string",
"schema_id": "format_18_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "validation of URI References",
"database": {
"types": [
{
"name": "format_19_0",
"schemas": {
"format_19_0": {
"format": "uri-reference"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URI",
"data": "http://foo.bar/?baz=qux#quux",
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid protocol-relative URI Reference",
"data": "//foo.bar/?baz=qux#quux",
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid relative URI Reference",
"data": "/abc",
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid URI Reference",
"data": "\\\\WINDOWS\\fileshare",
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "unexpected character at index 0",
"format": "uri-reference"
},
"details": {
"path": "",
"schema": "format_19_0"
}
}
]
}
},
{
"description": "a valid URI Reference",
"data": "abc",
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URI fragment",
"data": "#fragment",
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid URI fragment",
"data": "#frag\\ment",
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "unexpected character at index 5",
"format": "uri-reference"
},
"details": {
"path": "",
"schema": "format_19_0"
}
}
]
}
},
{
"description": "unescaped non US-ASCII characters",
"data": "/foobar®.txt",
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "unexpected character at index 7",
"format": "uri-reference"
},
"details": {
"path": "",
"schema": "format_19_0"
}
}
]
}
},
{
"description": "invalid backslash character",
"data": "https://example.org/foobar\\.txt",
"schema_id": "format_19_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri-reference",
"error": "unexpected character at index 26"
},
"details": {
"path": "",
"schema": "format_19_0"
}
}
]
}
}
]
},
{
"description": "format: uri-template",
"database": {
"types": [
{
"name": "format_20_0",
"schemas": {
"format_20_0": {
"format": "uri-template"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid uri-template",
"data": "http://example.com/dictionary/{term:1}/{term}",
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid uri-template",
"data": "http://example.com/dictionary/{term:1}/{term",
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri-template",
"error": "no matching closing brace"
},
"details": {
"path": "",
"schema": "format_20_0"
}
}
]
}
},
{
"description": "a valid uri-template without variables",
"data": "http://example.com/dictionary",
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid relative uri-template",
"data": "dictionary/{term:1}/{term}",
"schema_id": "format_20_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "validation of URIs",
"database": {
"types": [
{
"name": "format_21_0",
"schemas": {
"format_21_0": {
"format": "uri"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URL with anchor tag",
"data": "http://foo.bar/?baz=qux#quux",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URL with anchor tag and parentheses",
"data": "http://foo.com/blah_(wikipedia)_blah#cite-1",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URL with URL-encoded stuff",
"data": "http://foo.bar/?q=Test%20URL-encoded%20stuff",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid puny-coded URL ",
"data": "http://xn--nw2a.xn--j6w193g/",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URL with many special characters",
"data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URL based on IPv4",
"data": "http://223.255.255.254",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URL with ftp scheme",
"data": "ftp://ftp.is.co.za/rfc/rfc1808.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URL for a simple text file",
"data": "http://www.ietf.org/rfc/rfc2396.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URL ",
"data": "ldap://[2001:db8::7]/c=GB?objectClass?one",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid mailto URI",
"data": "mailto:John.Doe@example.com",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid newsgroup URI",
"data": "news:comp.infosystems.www.servers.unix",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid tel URI",
"data": "tel:+1-816-555-1212",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "a valid URN",
"data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "an invalid protocol-relative URI Reference",
"data": "//foo.bar/?baz=qux#quux",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "relative url"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "an invalid relative URI Reference",
"data": "/abc",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "relative url",
"format": "uri"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "an invalid URI",
"data": "\\\\WINDOWS\\fileshare",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "unexpected character at index 0",
"format": "uri"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "an invalid URI though valid URI reference",
"data": "abc",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "relative url",
"format": "uri"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "an invalid URI with spaces",
"data": "http:// shouldfail.com",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "unexpected character at index 7",
"format": "uri"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "an invalid URI with spaces and missing scheme",
"data": ":// should fail",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "unexpected character at index 0"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "an invalid URI with comma in scheme",
"data": "bar,baz:foo",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "unexpected character at index 7"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "invalid userinfo",
"data": "https://[@example.org/test.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "unexpected character at index 9"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "unescaped non US-ASCII characters",
"data": "https://example.org/foobar®.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "unexpected character at index 26"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "invalid backslash character",
"data": "https://example.org/foobar\\.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "unexpected character at index 26"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "invalid \" character",
"data": "https://example.org/foobar\".txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "unexpected character at index 26"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "invalid <> characters",
"data": "https://example.org/foobar<>.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "unexpected character at index 26"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "invalid {} characters",
"data": "https://example.org/foobar{}.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "unexpected character at index 26",
"format": "uri"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "invalid ^ character",
"data": "https://example.org/foobar^.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "unexpected character at index 26",
"format": "uri"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "invalid ` character",
"data": "https://example.org/foobar`.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "unexpected character at index 26",
"format": "uri"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "invalid SPACE character",
"data": "https://example.org/foo bar.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "unexpected character at index 23"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
},
{
"description": "invalid | character",
"data": "https://example.org/foobar|.txt",
"schema_id": "format_21_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uri",
"error": "unexpected character at index 26"
},
"details": {
"path": "",
"schema": "format_21_0"
}
}
]
}
}
]
},
{
"description": "uuid format",
"database": {
"types": [
{
"name": "format_22_0",
"schemas": {
"format_22_0": {
"format": "uuid"
}
}
}
]
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore objects",
"data": {},
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore arrays",
"data": [],
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore booleans",
"data": false,
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all string formats ignore nulls",
"data": null,
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all upper-case",
"data": "2EB8AA08-AA98-11EA-B4AA-73B441D16380",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all lower-case",
"data": "2eb8aa08-aa98-11ea-b4aa-73b441d16380",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "mixed case",
"data": "2eb8aa08-AA98-11ea-B4Aa-73B441D16380",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "all zeroes is valid",
"data": "00000000-0000-0000-0000-000000000000",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "wrong length",
"data": "2eb8aa08-aa98-11ea-b4aa-73b441d1638",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "element 5 must be 12 characters long",
"format": "uuid"
},
"details": {
"path": "",
"schema": "format_22_0"
}
}
]
}
},
{
"description": "missing section",
"data": "2eb8aa08-aa98-11ea-73b441d16380",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "element 4 must be 4 characters long",
"format": "uuid"
},
"details": {
"path": "",
"schema": "format_22_0"
}
}
]
}
},
{
"description": "bad characters (not hex)",
"data": "2eb8aa08-aa98-11ea-b4ga-73b441d16380",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uuid",
"error": "non-hex character 'g'"
},
"details": {
"path": "",
"schema": "format_22_0"
}
}
]
}
},
{
"description": "no dashes",
"data": "2eb8aa08aa9811eab4aa73b441d16380",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "element 1 must be 8 characters long",
"format": "uuid"
},
"details": {
"path": "",
"schema": "format_22_0"
}
}
]
}
},
{
"description": "too few dashes",
"data": "2eb8aa08aa98-11ea-b4aa73b441d16380",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "element 1 must be 8 characters long",
"format": "uuid"
},
"details": {
"path": "",
"schema": "format_22_0"
}
}
]
}
},
{
"description": "too many dashes",
"data": "2eb8-aa08-aa98-11ea-b4aa73b44-1d16380",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "element 1 must be 8 characters long",
"format": "uuid"
},
"details": {
"path": "",
"schema": "format_22_0"
}
}
]
}
},
{
"description": "dashes in the wrong spot",
"data": "2eb8aa08aa9811eab4aa73b441d16380----",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uuid",
"error": "element 1 must be 8 characters long"
},
"details": {
"path": "",
"schema": "format_22_0"
}
}
]
}
},
{
"description": "shifted dashes",
"data": "2eb8aa0-8aa98-11e-ab4aa7-3b441d16380",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"format": "uuid",
"error": "element 1 must be 8 characters long"
},
"details": {
"path": "",
"schema": "format_22_0"
}
}
]
}
},
{
"description": "valid version 4",
"data": "98d80576-482e-427f-8434-7f86890ab222",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid version 5",
"data": "99c17cbb-656f-564a-940f-1a4568f03487",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "hypothetical version 6",
"data": "99c17cbb-656f-664a-940f-1a4568f03487",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "hypothetical version 15",
"data": "99c17cbb-656f-f64a-940f-1a4568f03487",
"schema_id": "format_22_0",
"action": "validate",
"expect": {
"success": true
}
}
]
},
{
"description": "period format",
"database": {
"types": [
{
"name": "format_23_0",
"schemas": {
"format_23_0": {
"format": "period"
}
}
}
]
},
"tests": [
{
"description": "valid period (start/duration)",
"data": "2020-01-01T00:00:00Z/P1Y",
"schema_id": "format_23_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid period (duration/end)",
"data": "P1Y/2021-01-01T00:00:00Z",
"schema_id": "format_23_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "valid period (start/end)",
"data": "2020-01-01T00:00:00Z/2021-01-01T00:00:00Z",
"schema_id": "format_23_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "invalid period (missing slash)",
"data": "2020-01-01T00:00:00ZP1Y",
"schema_id": "format_23_0",
"action": "validate",
"expect": {
"success": false,
"errors": [
{
"code": "FORMAT_MISMATCH",
"values": {
"error": "missing slash",
"format": "period"
},
"details": {
"path": "",
"schema": "format_23_0"
}
}
]
}
},
{
"description": "ignores non-strings",
"data": 123,
"schema_id": "format_23_0",
"action": "validate",
"expect": {
"success": true
}
}
]
}
]