Ajout du validateur json + correctif factory metadata
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
[
|
||||
{
|
||||
"description": "integer",
|
||||
"schema": { "type": "integer" },
|
||||
"tests": [
|
||||
{
|
||||
"description": "a bignum is an integer",
|
||||
"data": 12345678910111213141516171819202122232425262728293031,
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a negative bignum is an integer",
|
||||
"data": -12345678910111213141516171819202122232425262728293031,
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "number",
|
||||
"schema": { "type": "number" },
|
||||
"tests": [
|
||||
{
|
||||
"description": "a bignum is a number",
|
||||
"data": 98249283749234923498293171823948729348710298301928331,
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a negative bignum is a number",
|
||||
"data": -98249283749234923498293171823948729348710298301928331,
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "string",
|
||||
"schema": { "type": "string" },
|
||||
"tests": [
|
||||
{
|
||||
"description": "a bignum is not a string",
|
||||
"data": 98249283749234923498293171823948729348710298301928331,
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "integer comparison",
|
||||
"schema": { "maximum": 18446744073709551615 },
|
||||
"tests": [
|
||||
{
|
||||
"description": "comparison works for high numbers",
|
||||
"data": 18446744073709551600,
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "float comparison with high precision",
|
||||
"schema": {
|
||||
"exclusiveMaximum": 972783798187987123879878123.18878137
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "comparison works for high numbers",
|
||||
"data": 972783798187987123879878123.188781371,
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "integer comparison",
|
||||
"schema": { "minimum": -18446744073709551615 },
|
||||
"tests": [
|
||||
{
|
||||
"description": "comparison works for very negative numbers",
|
||||
"data": -18446744073709551600,
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "float comparison with high precision on negative numbers",
|
||||
"schema": {
|
||||
"exclusiveMinimum": -972783798187987123879878123.18878137
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "comparison works for very negative numbers",
|
||||
"data": -972783798187987123879878123.188781371,
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,77 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of string-encoded content based on media type",
|
||||
"schema": {
|
||||
"contentMediaType": "application/json"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid JSON document",
|
||||
"data": "{\"foo\": \"bar\"}",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid JSON document",
|
||||
"data": "{:}",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "ignores non-strings",
|
||||
"data": 100,
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "validation of binary string-encoding",
|
||||
"schema": {
|
||||
"contentEncoding": "base64"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid base64 string",
|
||||
"data": "eyJmb28iOiAiYmFyIn0K",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid base64 string (% is not a valid character)",
|
||||
"data": "eyJmb28iOi%iYmFyIn0K",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "ignores non-strings",
|
||||
"data": 100,
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "validation of binary-encoded media type documents",
|
||||
"schema": {
|
||||
"contentMediaType": "application/json",
|
||||
"contentEncoding": "base64"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid base64-encoded JSON document",
|
||||
"data": "eyJmb28iOiAiYmFyIn0K",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a validly-encoded invalid JSON document",
|
||||
"data": "ezp9Cg==",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid base64 string that is valid JSON",
|
||||
"data": "{}",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "ignores non-strings",
|
||||
"data": 100,
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,292 @@
|
||||
[
|
||||
{
|
||||
"description": "ECMA 262 regex $ does not match trailing newline",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^abc$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "matches in Python, but should not in jsonschema",
|
||||
"data": "abc\\n",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "should match",
|
||||
"data": "abc",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ECMA 262 regex converts \\t to horizontal tab",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^\\t$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "does not match",
|
||||
"data": "\\t",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "matches",
|
||||
"data": "\u0009",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ECMA 262 regex escapes control codes with \\c and upper letter",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^\\cC$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "does not match",
|
||||
"data": "\\cC",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "matches",
|
||||
"data": "\u0003",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ECMA 262 regex escapes control codes with \\c and lower letter",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^\\cc$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "does not match",
|
||||
"data": "\\cc",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "matches",
|
||||
"data": "\u0003",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ECMA 262 \\d matches ascii digits only",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^\\d$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "ASCII zero matches",
|
||||
"data": "0",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "NKO DIGIT ZERO does not match (unlike e.g. Python)",
|
||||
"data": "߀",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "NKO DIGIT ZERO (as \\u escape) does not match",
|
||||
"data": "\u07c0",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ECMA 262 \\D matches everything but ascii digits",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^\\D$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "ASCII zero does not match",
|
||||
"data": "0",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "NKO DIGIT ZERO matches (unlike e.g. Python)",
|
||||
"data": "߀",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "NKO DIGIT ZERO (as \\u escape) matches",
|
||||
"data": "\u07c0",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ECMA 262 \\w matches ascii letters only",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^\\w$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "ASCII 'a' matches",
|
||||
"data": "a",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "latin-1 e-acute does not match (unlike e.g. Python)",
|
||||
"data": "é",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ECMA 262 \\W matches everything but ascii letters",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^\\W$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "ASCII 'a' does not match",
|
||||
"data": "a",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "latin-1 e-acute matches (unlike e.g. Python)",
|
||||
"data": "é",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ECMA 262 \\s matches whitespace",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^\\s$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "ASCII space matches",
|
||||
"data": " ",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "Character tabulation matches",
|
||||
"data": "\t",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "Line tabulation matches",
|
||||
"data": "\u000b",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "Form feed matches",
|
||||
"data": "\u000c",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "latin-1 non-breaking-space matches",
|
||||
"data": "\u00a0",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "zero-width whitespace matches",
|
||||
"data": "\ufeff",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "line feed matches (line terminator)",
|
||||
"data": "\u000a",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "paragraph separator matches (line terminator)",
|
||||
"data": "\u2029",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "EM SPACE matches (Space_Separator)",
|
||||
"data": "\u2003",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "Non-whitespace control does not match",
|
||||
"data": "\u0001",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "Non-whitespace does not match",
|
||||
"data": "\u2013",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ECMA 262 \\S matches everything but whitespace",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^\\S$"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "ASCII space does not match",
|
||||
"data": " ",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "Character tabulation does not match",
|
||||
"data": "\t",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "Line tabulation does not match",
|
||||
"data": "\u000b",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "Form feed does not match",
|
||||
"data": "\u000c",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "latin-1 non-breaking-space does not match",
|
||||
"data": "\u00a0",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "zero-width whitespace does not match",
|
||||
"data": "\ufeff",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "line feed does not match (line terminator)",
|
||||
"data": "\u000a",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "paragraph separator does not match (line terminator)",
|
||||
"data": "\u2029",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "EM SPACE does not match (Space_Separator)",
|
||||
"data": "\u2003",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "Non-whitespace control matches",
|
||||
"data": "\u0001",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "Non-whitespace matches",
|
||||
"data": "\u2013",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,13 @@
|
||||
[
|
||||
{
|
||||
"description": "all integers are multiples of 0.5, if overflow is handled",
|
||||
"schema": {"type": "integer", "multipleOf": 0.5},
|
||||
"tests": [
|
||||
{
|
||||
"description": "valid if optional overflow handling is implemented",
|
||||
"data": 1e308,
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,73 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of date-time strings",
|
||||
"schema": {"format": "date-time"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid date-time string",
|
||||
"data": "1963-06-19T08:30:06.283185Z",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid date-time string without second fraction",
|
||||
"data": "1963-06-19T08:30:06Z",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid date-time string with plus offset",
|
||||
"data": "1937-01-01T12:00:27.87+00:20",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid date-time string with minus offset",
|
||||
"data": "1990-12-31T15:59:50.123-08:00",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid day in date-time string",
|
||||
"data": "1990-02-31T15:59:60.123-08:00",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid offset in date-time string",
|
||||
"data": "1990-12-31T15:59:60-24:00",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid date-time string",
|
||||
"data": "06/19/1963 08:30:06 PST",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "case-insensitive T and Z",
|
||||
"data": "1963-06-19t08:30:06.283185z",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "only RFC3339 not all of ISO 8601 are valid",
|
||||
"data": "2013-350T01:01:01",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "invalid non-padded month dates",
|
||||
"data": "1963-6-19T08:30:06.283185Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "invalid non-padded day dates",
|
||||
"data": "1963-06-1T08:30:06.283185Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "non-ascii digits should be rejected in the date portion",
|
||||
"data": "1963-06-1৪T00:00:00Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "non-ascii digits should be rejected in the time portion",
|
||||
"data": "1963-06-11T0৪:00:00Z",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,193 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of date strings",
|
||||
"schema": {"format": "date"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid date string",
|
||||
"data": "1963-06-19",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 31 days in January",
|
||||
"data": "2020-01-31",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 32 days in January",
|
||||
"data": "2020-01-32",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 28 days in February (normal)",
|
||||
"data": "2021-02-28",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 29 days in February (normal)",
|
||||
"data": "2021-02-29",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 29 days in February (leap)",
|
||||
"data": "2020-02-29",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 30 days in February (leap)",
|
||||
"data": "2020-02-30",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 31 days in March",
|
||||
"data": "2020-03-31",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 32 days in March",
|
||||
"data": "2020-03-32",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 30 days in April",
|
||||
"data": "2020-04-30",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 31 days in April",
|
||||
"data": "2020-04-31",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 31 days in May",
|
||||
"data": "2020-05-31",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 32 days in May",
|
||||
"data": "2020-05-32",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 30 days in June",
|
||||
"data": "2020-06-30",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 31 days in June",
|
||||
"data": "2020-06-31",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 31 days in July",
|
||||
"data": "2020-07-31",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 32 days in July",
|
||||
"data": "2020-07-32",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 31 days in August",
|
||||
"data": "2020-08-31",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 32 days in August",
|
||||
"data": "2020-08-32",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 30 days in September",
|
||||
"data": "2020-09-30",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 31 days in September",
|
||||
"data": "2020-09-31",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 31 days in October",
|
||||
"data": "2020-10-31",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 32 days in October",
|
||||
"data": "2020-10-32",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 30 days in November",
|
||||
"data": "2020-11-30",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 31 days in November",
|
||||
"data": "2020-11-31",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid date string with 31 days in December",
|
||||
"data": "2020-12-31",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with 32 days in December",
|
||||
"data": "2020-12-32",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a invalid date string with invalid month",
|
||||
"data": "2020-13-01",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid date string",
|
||||
"data": "06/19/1963",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "only RFC3339 not all of ISO 8601 are valid",
|
||||
"data": "2013-350",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "non-padded month dates are not valid",
|
||||
"data": "1998-1-20",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "non-padded day dates are not valid",
|
||||
"data": "1998-01-1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "invalid month",
|
||||
"data": "1998-13-01",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "invalid month-day combination",
|
||||
"data": "1998-04-31",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "2021 is not a leap year",
|
||||
"data": "2021-02-29",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "2020 is a leap year",
|
||||
"data": "2020-02-29",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "non-ascii digits should be rejected",
|
||||
"data": "1963-06-1৪",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,53 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of e-mail addresses",
|
||||
"schema": {"format": "email"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid e-mail address",
|
||||
"data": "joe.bloggs@example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid e-mail address",
|
||||
"data": "2962",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "tilde in local part is valid",
|
||||
"data": "te~st@example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "tilde before local part is valid",
|
||||
"data": "~test@example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "tilde after local part is valid",
|
||||
"data": "test~@example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "dot before local part is not valid",
|
||||
"data": ".test@example.com",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "dot after local part is not valid",
|
||||
"data": "test.@example.com",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "two separated dots inside local part are valid",
|
||||
"data": "te.s.t@example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "two subsequent dots inside local part are not valid",
|
||||
"data": "te..st@example.com",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,68 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of host names",
|
||||
"schema": {"format": "hostname"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid host name",
|
||||
"data": "www.example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid punycoded IDN hostname",
|
||||
"data": "xn--4gbwdl.xn--wgbh1c",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a host name starting with an illegal character",
|
||||
"data": "-a-host-name-that-starts-with--",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a host name containing illegal characters",
|
||||
"data": "not_a_valid_host_name",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a host name with a component too long",
|
||||
"data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "starts with hyphen",
|
||||
"data": "-hostname",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "ends with hyphen",
|
||||
"data": "hostname-",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "starts with underscore",
|
||||
"data": "_hostname",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "ends with underscore",
|
||||
"data": "hostname_",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "contains underscore",
|
||||
"data": "host_name",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "maximum label length",
|
||||
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "exceeds maximum label length",
|
||||
"data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,28 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of an internationalized e-mail addresses",
|
||||
"schema": {"format": "idn-email"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid idn e-mail (example@example.test in Hangul)",
|
||||
"data": "실례@실례.테스트",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid idn e-mail address",
|
||||
"data": "2962",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid e-mail address",
|
||||
"data": "joe.bloggs@example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid e-mail address",
|
||||
"data": "2962",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,274 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of internationalized host names",
|
||||
"schema": {"format": "idn-hostname"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid host name (example.test in Hangul)",
|
||||
"data": "실례.테스트",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "illegal first char U+302E Hangul single dot tone mark",
|
||||
"data": "〮실례.테스트",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "contains illegal char U+302E Hangul single dot tone mark",
|
||||
"data": "실〮례.테스트",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a host name with a component too long",
|
||||
"data": "실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실례례테스트례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례테스트례례실례.테스트",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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 <--",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"valid": 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",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "U-label starts with a dash",
|
||||
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
|
||||
"data": "-hello",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "U-label ends with a dash",
|
||||
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
|
||||
"data": "hello-",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "U-label starts and ends with a dash",
|
||||
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1",
|
||||
"data": "-hello-",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "Begins with a Spacing Combining Mark",
|
||||
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
|
||||
"data": "\u0903hello",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "Begins with a Nonspacing Mark",
|
||||
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
|
||||
"data": "\u0300hello",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "Begins with an Enclosing Mark",
|
||||
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
|
||||
"data": "\u0488hello",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u00df\u03c2\u0f0b\u3007",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "Exceptions that are PVALID, right-to-left chars",
|
||||
"comment": "https://tools.ietf.org/html/rfc/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
|
||||
"data": "\u06fd\u06fe",
|
||||
"valid": 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": "\u0640\u07fa",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u3031\u3032\u3033\u3034\u3035\u302e\u302f\u303b",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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\u00b7l",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u00b7l",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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\u00b7a",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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\u00b7",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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\u00b7l",
|
||||
"valid": 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": "\u03b1\u0375S",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u03b1\u0375",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u03b1\u0375\u03b2",
|
||||
"valid": 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\u05f3\u05d1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u05f3\u05d1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u05d0\u05f3\u05d1",
|
||||
"valid": 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\u05f4\u05d1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u05f4\u05d1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u05d0\u05f4\u05d1",
|
||||
"valid": 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\u30fbabc",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u30fb",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u30fb\u3041",
|
||||
"valid": 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": "\u30fb\u30a1",
|
||||
"valid": 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": "\u30fb\u4e08",
|
||||
"valid": 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": "\u0660\u06f0",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u0628\u0660\u0628",
|
||||
"valid": 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": "\u06f00",
|
||||
"valid": 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": "\u0915\u200d\u0937",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u200d\u0937",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"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": "\u0915\u094d\u200d\u0937",
|
||||
"valid": 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": "\u0915\u094d\u200c\u0937",
|
||||
"valid": 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": "\u0628\u064a\u200c\u0628\u064a",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,54 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of IP addresses",
|
||||
"schema": {"format": "ipv4"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid IP address",
|
||||
"data": "192.168.0.1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an IP address with too many components",
|
||||
"data": "127.0.0.0.1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an IP address with out-of-range values",
|
||||
"data": "256.256.256.256",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an IP address without 4 components",
|
||||
"data": "127.0",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an IP address as an integer",
|
||||
"data": "0x7f000001",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an IP address as an integer (decimal)",
|
||||
"data": "2130706433",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "leading zeroes should be rejected, 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",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "value without leading zero is valid",
|
||||
"data": "87.10.0.1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "non-ascii digits should be rejected",
|
||||
"data": "1২7.0.0.1",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,163 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of IPv6 addresses",
|
||||
"schema": {"format": "ipv6"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid IPv6 address",
|
||||
"data": "::1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an IPv6 address with out-of-range values",
|
||||
"data": "12345::",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an IPv6 address with too many components",
|
||||
"data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an IPv6 address containing illegal characters",
|
||||
"data": "::laptop",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "no digits is valid",
|
||||
"data": "::",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "leading colons is valid",
|
||||
"data": "::42:ff:1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "trailing colons is valid",
|
||||
"data": "d6::",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "missing leading octet is invalid",
|
||||
"data": ":2:3:4:5:6:7:8",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "missing trailing octet is invalid",
|
||||
"data": "1:2:3:4:5:6:7:",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "missing leading octet with omitted octets later",
|
||||
"data": ":2:3:4::8",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "two sets of double colons is invalid",
|
||||
"data": "1::d6::42",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "mixed format with the ipv4 section as decimal octets",
|
||||
"data": "1::d6:192.168.0.1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "mixed format with double colons between the sections",
|
||||
"data": "1:2::192.168.0.1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "mixed format with ipv4 section with octet out of range",
|
||||
"data": "1::2:192.168.256.1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "mixed format with ipv4 section with a hex octet",
|
||||
"data": "1::2:192.168.ff.1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "mixed format with leading double colons (ipv4-mapped ipv6 address)",
|
||||
"data": "::ffff:192.168.0.1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "triple colons is invalid",
|
||||
"data": "1:2:3:4:5:::8",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "8 octets",
|
||||
"data": "1:2:3:4:5:6:7:8",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "insufficient octets without double colons",
|
||||
"data": "1:2:3:4:5:6:7",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "no colons is invalid",
|
||||
"data": "1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "ipv4 is not ipv6",
|
||||
"data": "127.0.0.1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "ipv4 segment must have 4 octets",
|
||||
"data": "1:2:3:4:1.2.3",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "leading whitespace is invalid",
|
||||
"data": " ::1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "trailing whitespace is invalid",
|
||||
"data": "::1 ",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "netmask is not a part of ipv6 address",
|
||||
"data": "fe80::/64",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "zone id is not a part of ipv6 address",
|
||||
"data": "fe80::a%eth1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a long valid ipv6",
|
||||
"data": "1000:1000:1000:1000:1000:1000:255.255.255.255",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a long invalid ipv6, below length limit, first",
|
||||
"data": "100:100:100:100:100:100:255.255.255.255.255",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a long invalid ipv6, below length limit, second",
|
||||
"data": "100:100:100:100:100:100:100:255.255.255.255",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "non-ascii digits should be rejected",
|
||||
"data": "1:2:3:4:5:6:7:৪",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "non-ascii digits should be rejected in the ipv4 portion also",
|
||||
"data": "1:2::192.16৪.0.1",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,43 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of IRI References",
|
||||
"schema": {"format": "iri-reference"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid IRI",
|
||||
"data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid protocol-relative IRI Reference",
|
||||
"data": "//ƒøø.ßår/?∂éœ=πîx#πîüx",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid relative IRI Reference",
|
||||
"data": "/âππ",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid IRI Reference",
|
||||
"data": "\\\\WINDOWS\\filëßåré",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid IRI Reference",
|
||||
"data": "âππ",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid IRI fragment",
|
||||
"data": "#ƒrägmênt",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid IRI fragment",
|
||||
"data": "#ƒräg\\mênt",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,53 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of IRIs",
|
||||
"schema": {"format": "iri"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid IRI with anchor tag",
|
||||
"data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid IRI with anchor tag and parentheses",
|
||||
"data": "http://ƒøø.com/blah_(wîkïpédiå)_blah#ßité-1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid IRI with URL-encoded stuff",
|
||||
"data": "http://ƒøø.ßår/?q=Test%20URL-encoded%20stuff",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid IRI with many special characters",
|
||||
"data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid IRI based on IPv6",
|
||||
"data": "http://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid IRI based on IPv6",
|
||||
"data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid relative IRI Reference",
|
||||
"data": "/abc",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid IRI",
|
||||
"data": "\\\\WINDOWS\\filëßåré",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid IRI though valid IRI reference",
|
||||
"data": "âππ",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,168 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of JSON-pointers (JSON String Representation)",
|
||||
"schema": {"format": "json-pointer"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid JSON-pointer",
|
||||
"data": "/foo/bar~0/baz~1/%a",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (~ not escaped)",
|
||||
"data": "/foo/bar~",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer with empty segment",
|
||||
"data": "/foo//bar",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer with the last empty segment",
|
||||
"data": "/foo/bar/",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #1",
|
||||
"data": "",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #2",
|
||||
"data": "/foo",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #3",
|
||||
"data": "/foo/0",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #4",
|
||||
"data": "/",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #5",
|
||||
"data": "/a~1b",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #6",
|
||||
"data": "/c%d",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #7",
|
||||
"data": "/e^f",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #8",
|
||||
"data": "/g|h",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #9",
|
||||
"data": "/i\\j",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #10",
|
||||
"data": "/k\"l",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #11",
|
||||
"data": "/ ",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer as stated in RFC 6901 #12",
|
||||
"data": "/m~0n",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer used adding to the last array position",
|
||||
"data": "/foo/-",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer (- used as object member name)",
|
||||
"data": "/foo/-/bar",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer (multiple escaped characters)",
|
||||
"data": "/~1~0~0~1~1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer (escaped with fraction part) #1",
|
||||
"data": "/~1.1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid JSON-pointer (escaped with fraction part) #2",
|
||||
"data": "/~0.1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (URI Fragment Identifier) #1",
|
||||
"data": "#",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (URI Fragment Identifier) #2",
|
||||
"data": "#/",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (URI Fragment Identifier) #3",
|
||||
"data": "#a",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (some escaped, but not all) #1",
|
||||
"data": "/~0~",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (some escaped, but not all) #2",
|
||||
"data": "/~0/~",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (wrong escape character) #1",
|
||||
"data": "/~2",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (wrong escape character) #2",
|
||||
"data": "/~-1",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (multiple characters not escaped)",
|
||||
"data": "/~~",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #1",
|
||||
"data": "a",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #2",
|
||||
"data": "0",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #3",
|
||||
"data": "a/a",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of regular expressions",
|
||||
"schema": {"format": "regex"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid regular expression",
|
||||
"data": "([abc])+\\s+$",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a regular expression with unclosed parens is invalid",
|
||||
"data": "^(abc]",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,53 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of Relative JSON Pointers (RJP)",
|
||||
"schema": {"format": "relative-json-pointer"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid upwards RJP",
|
||||
"data": "1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid downwards RJP",
|
||||
"data": "0/foo/bar",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid up and then down RJP, with array index",
|
||||
"data": "2/0/baz/1/zip",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid RJP taking the member or index name",
|
||||
"data": "0#",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid RJP that is a valid JSON Pointer",
|
||||
"data": "/foo/bar",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "negative prefix",
|
||||
"data": "-1/foo/bar",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "## is not a valid json-pointer",
|
||||
"data": "0##",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "zero cannot be followed by other digits, plus json-pointer",
|
||||
"data": "01/a",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "zero cannot be followed by other digits, plus octothorpe",
|
||||
"data": "01#",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,168 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of time strings",
|
||||
"schema": {"format": "time"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid time string",
|
||||
"data": "08:30:06Z",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid time string with leap second, Zulu",
|
||||
"data": "23:59:60Z",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "invalid leap second, Zulu (wrong hour)",
|
||||
"data": "22:59:60Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "invalid leap second, Zulu (wrong minute)",
|
||||
"data": "23:58:60Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "valid leap second, zero time-offset",
|
||||
"data": "23:59:60+00:00",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "invalid leap second, zero time-offset (wrong hour)",
|
||||
"data": "22:59:60+00:00",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "invalid leap second, zero time-offset (wrong minute)",
|
||||
"data": "23:58:60+00:00",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "valid leap second, positive time-offset",
|
||||
"data": "01:29:60+01:30",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid leap second, large positive time-offset",
|
||||
"data": "23:29:60+23:30",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "invalid leap second, positive time-offset (wrong hour)",
|
||||
"data": "23:59:60+01:00",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "invalid leap second, positive time-offset (wrong minute)",
|
||||
"data": "23:59:60+00:30",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "valid leap second, negative time-offset",
|
||||
"data": "15:59:60-08:00",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid leap second, large negative time-offset",
|
||||
"data": "00:29:60-23:30",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "invalid leap second, negative time-offset (wrong hour)",
|
||||
"data": "23:59:60-01:00",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "invalid leap second, negative time-offset (wrong minute)",
|
||||
"data": "23:59:60-00:30",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid time string with second fraction",
|
||||
"data": "23:20:50.52Z",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid time string with precise second fraction",
|
||||
"data": "08:30:06.283185Z",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid time string with plus offset",
|
||||
"data": "08:30:06+00:20",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid time string with minus offset",
|
||||
"data": "08:30:06-08:00",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid time string with case-insensitive Z",
|
||||
"data": "08:30:06z",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid time string with invalid hour",
|
||||
"data": "24:00:00Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid time string with invalid minute",
|
||||
"data": "00:60:00Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid time string with invalid second",
|
||||
"data": "00:00:61Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid time string with invalid leap second (wrong hour)",
|
||||
"data": "22:59:60Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid time string with invalid leap second (wrong minute)",
|
||||
"data": "23:58:60Z",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid time string with invalid time numoffset hour",
|
||||
"data": "01:02:03+24:00",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid time string with invalid time numoffset minute",
|
||||
"data": "01:02:03+00:60",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid time string with invalid time with both Z and numoffset",
|
||||
"data": "01:02:03Z+00:30",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid offset indicator",
|
||||
"data": "08:30:06 PST",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "only RFC3339 not all of ISO 8601 are valid",
|
||||
"data": "01:01:01,1111",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "no time offset",
|
||||
"data": "12:00:00",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "non-ascii digits should be rejected",
|
||||
"data": "1২:00:00Z",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,43 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of URI References",
|
||||
"schema": {"format": "uri-reference"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid URI",
|
||||
"data": "http://foo.bar/?baz=qux#quux",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid protocol-relative URI Reference",
|
||||
"data": "//foo.bar/?baz=qux#quux",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid relative URI Reference",
|
||||
"data": "/abc",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid URI Reference",
|
||||
"data": "\\\\WINDOWS\\fileshare",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid URI Reference",
|
||||
"data": "abc",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid URI fragment",
|
||||
"data": "#fragment",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid URI fragment",
|
||||
"data": "#frag\\ment",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,28 @@
|
||||
[
|
||||
{
|
||||
"description": "format: uri-template",
|
||||
"schema": {"format": "uri-template"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid uri-template",
|
||||
"data": "http://example.com/dictionary/{term:1}/{term}",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid uri-template",
|
||||
"data": "http://example.com/dictionary/{term:1}/{term",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "a valid uri-template without variables",
|
||||
"data": "http://example.com/dictionary",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid relative uri-template",
|
||||
"data": "dictionary/{term:1}/{term}",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,108 @@
|
||||
[
|
||||
{
|
||||
"description": "validation of URIs",
|
||||
"schema": {"format": "uri"},
|
||||
"tests": [
|
||||
{
|
||||
"description": "a valid URL with anchor tag",
|
||||
"data": "http://foo.bar/?baz=qux#quux",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid URL with anchor tag and parentheses",
|
||||
"data": "http://foo.com/blah_(wikipedia)_blah#cite-1",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid URL with URL-encoded stuff",
|
||||
"data": "http://foo.bar/?q=Test%20URL-encoded%20stuff",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid puny-coded URL ",
|
||||
"data": "http://xn--nw2a.xn--j6w193g/",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid URL with many special characters",
|
||||
"data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid URL based on IPv4",
|
||||
"data": "http://223.255.255.254",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid URL with ftp scheme",
|
||||
"data": "ftp://ftp.is.co.za/rfc/rfc1808.txt",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid URL for a simple text file",
|
||||
"data": "http://www.ietf.org/rfc/rfc2396.txt",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid URL ",
|
||||
"data": "ldap://[2001:db8::7]/c=GB?objectClass?one",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid mailto URI",
|
||||
"data": "mailto:John.Doe@example.com",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid newsgroup URI",
|
||||
"data": "news:comp.infosystems.www.servers.unix",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid tel URI",
|
||||
"data": "tel:+1-816-555-1212",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "a valid URN",
|
||||
"data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "an invalid protocol-relative URI Reference",
|
||||
"data": "//foo.bar/?baz=qux#quux",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid relative URI Reference",
|
||||
"data": "/abc",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid URI",
|
||||
"data": "\\\\WINDOWS\\fileshare",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid URI though valid URI reference",
|
||||
"data": "abc",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid URI with spaces",
|
||||
"data": "http:// shouldfail.com",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid URI with spaces and missing scheme",
|
||||
"data": ":// should fail",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "an invalid URI with comma in scheme",
|
||||
"data": "bar,baz:foo",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,85 @@
|
||||
[
|
||||
{
|
||||
"description": "uuid format",
|
||||
"schema": {
|
||||
"format": "uuid"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "all upper-case",
|
||||
"data": "2EB8AA08-AA98-11EA-B4AA-73B441D16380",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "all lower-case",
|
||||
"data": "2eb8aa08-aa98-11ea-b4aa-73b441d16380",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "mixed case",
|
||||
"data": "2eb8aa08-AA98-11ea-B4Aa-73B441D16380",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "all zeroes is valid",
|
||||
"data": "00000000-0000-0000-0000-000000000000",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "wrong length",
|
||||
"data": "2eb8aa08-aa98-11ea-b4aa-73b441d1638",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "missing section",
|
||||
"data": "2eb8aa08-aa98-11ea-73b441d16380",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "bad characters (not hex)",
|
||||
"data": "2eb8aa08-aa98-11ea-b4ga-73b441d16380",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "no dashes",
|
||||
"data": "2eb8aa08aa9811eab4aa73b441d16380",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "too few dashes",
|
||||
"data": "2eb8aa08aa98-11ea-b4aa73b441d16380",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "too many dashes",
|
||||
"data": "2eb8-aa08-aa98-11ea-b4aa73b44-1d16380",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "dashes in the wrong spot",
|
||||
"data": "2eb8aa08aa9811eab4aa73b441d16380----",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "valid version 4",
|
||||
"data": "98d80576-482e-427f-8434-7f86890ab222",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "valid version 5",
|
||||
"data": "99c17cbb-656f-564a-940f-1a4568f03487",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "hypothetical version 6",
|
||||
"data": "99c17cbb-656f-664a-940f-1a4568f03487",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "hypothetical version 15",
|
||||
"data": "99c17cbb-656f-f64a-940f-1a4568f03487",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,82 @@
|
||||
[
|
||||
{
|
||||
"description": "Proper UTF-16 surrogate pair handling: pattern",
|
||||
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
|
||||
"schema": { "pattern": "^🐲*$" },
|
||||
"tests": [
|
||||
{
|
||||
"description": "matches empty",
|
||||
"data": "",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "matches single",
|
||||
"data": "🐲",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "matches two",
|
||||
"data": "🐲🐲",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "doesn't match one",
|
||||
"data": "🐉",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "doesn't match two",
|
||||
"data": "🐉🐉",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "doesn't match one ASCII",
|
||||
"data": "D",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "doesn't match two ASCII",
|
||||
"data": "DD",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Proper UTF-16 surrogate pair handling: patternProperties",
|
||||
"comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters",
|
||||
"schema": {
|
||||
"patternProperties": {
|
||||
"^🐲*$": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "matches empty",
|
||||
"data": { "": 1 },
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "matches single",
|
||||
"data": { "🐲": 1 },
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "matches two",
|
||||
"data": { "🐲🐲": 1 },
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "doesn't match one",
|
||||
"data": { "🐲": "hello" },
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "doesn't match two",
|
||||
"data": { "🐲🐲": "hello" },
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,146 @@
|
||||
[
|
||||
{
|
||||
"description": "unicode semantics should be used for all pattern matching",
|
||||
"schema": { "pattern": "\\wcole" },
|
||||
"tests": [
|
||||
{
|
||||
"description": "literal unicode character in json string",
|
||||
"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "unicode character in hex format in string",
|
||||
"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "unicode matching is case-sensitive",
|
||||
"data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "unicode characters do not match ascii ranges",
|
||||
"schema": { "pattern": "[a-z]cole" },
|
||||
"tests": [
|
||||
{
|
||||
"description": "literal unicode character in json string",
|
||||
"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "unicode character in hex format in string",
|
||||
"data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "ascii characters match",
|
||||
"data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "unicode digits are more than 0 through 9",
|
||||
"schema": { "pattern": "^\\d+$" },
|
||||
"tests": [
|
||||
{
|
||||
"description": "ascii digits",
|
||||
"data": "42",
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "ascii non-digits",
|
||||
"data": "-%#",
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)",
|
||||
"data": "৪২",
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "unicode semantics should be used for all patternProperties matching",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"\\wcole": true
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "literal unicode character in json string",
|
||||
"data": { "l'école": "pas de vraie vie" },
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "unicode character in hex format in string",
|
||||
"data": { "l'\u00e9cole": "pas de vraie vie" },
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "unicode matching is case-sensitive",
|
||||
"data": { "L'ÉCOLE": "PAS DE VRAIE VIE" },
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "unicode characters do not match ascii ranges",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"[a-z]cole": true
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "literal unicode character in json string",
|
||||
"data": { "l'école": "pas de vraie vie" },
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "unicode character in hex format in string",
|
||||
"data": { "l'\u00e9cole": "pas de vraie vie" },
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "ascii characters match",
|
||||
"data": { "l'ecole": "pas de vraie vie" },
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "unicode digits are more than 0 through 9",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"^\\d+$": true
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "ascii digits",
|
||||
"data": { "42": "life, the universe, and everything" },
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "ascii non-digits",
|
||||
"data": { "-%#": "spending the year dead for tax reasons" },
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)",
|
||||
"data": { "৪২": "khajit has wares if you have coin" },
|
||||
"valid": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user