diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/minProperties.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/minProperties.yml index 7a21183d..0df50a5d 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/minProperties.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/minProperties.yml @@ -24,6 +24,12 @@ - description: ignores other non-objects data: 12 valid: true + - description: ignores null + data: null + valid: true + - description: ignores booleans + data: true + valid: true - description: minProperties validation with a decimal schema: $schema: https://json-schema.org/draft/2019-09/schema diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/ecmascript-regex.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/ecmascript-regex.yml index 62d95797..d485d343 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/ecmascript-regex.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/ecmascript-regex.yml @@ -125,7 +125,7 @@ data: "\uFEFF" valid: true - description: line feed matches (line terminator) - data: |2+ + data: |+ valid: true - description: paragraph separator matches (line terminator) @@ -165,7 +165,7 @@ data: "\uFEFF" valid: false - description: line feed does not match (line terminator) - data: |2+ + data: |+ valid: false - description: paragraph separator does not match (line terminator) diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/date.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/date.yml index efeccdea..47d6a428 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/date.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/date.yml @@ -33,12 +33,6 @@ - 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 @@ -102,9 +96,6 @@ - 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 @@ -120,9 +111,6 @@ - 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 @@ -147,3 +135,74 @@ - description: an invalid time string in date-time format data: "2020-11-28T23:55:45Z" valid: false + - description: year 0000 is a leap year (0 % 400 == 0) + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case + data: "0000-02-29" + valid: true + - description: century year 0100 is not a leap year + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0 + data: 0100-02-29 + valid: false + - description: century year 0400 is a leap year + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary + data: "0400-02-29" + valid: true + - description: century year 2100 is not a leap year + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year + data: 2100-02-29 + valid: false + - description: 'invalid: leading whitespace is not permitted' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace + data: ' 2024-01-15' + valid: false + - description: 'invalid: trailing whitespace is not permitted' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace + data: '2024-01-15 ' + valid: false + - description: 'invalid: month 00 is not valid per date-month range 01-12' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12 + data: 2024-00-15 + valid: false + - description: 'invalid: day 00 is not valid per date-mday minimum of 01' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31 + data: 2024-01-00 + valid: false + - description: 'invalid: empty string' + data: "" + valid: false + - description: 'invalid: embedded whitespace between year and month' + data: 2020 -01-01 + valid: false + - description: 'invalid: trailing character after valid full-date' + data: 2020-01-01X + valid: false + - description: 'invalid: trailing Z after full-date' + data: 2020-01-01Z + valid: false + - description: 'invalid: full-date followed by space and time component' + data: 2020-01-01 00:00:00Z + valid: false + - description: 'valid: four-digit year 0001' + data: "0001-01-01" + valid: true + - description: 'invalid: two-digit year (N-2 digits)' + data: 20-01-01 + valid: false + - description: 'invalid: three-digit year (N-1 digits)' + data: 998-01-01 + valid: false + - description: 'invalid: five-digit year (N+1 digits)' + data: 12020-01-01 + valid: false + - description: 'invalid: positive sign prefix on year' + data: +2020-01-01 + valid: false + - description: 'invalid: negative sign prefix on year' + data: -2020-01-01 + valid: false + - description: 'invalid: non-ASCII Bengali digit in year field' + data: ২020-01-01 + valid: false + - description: 'invalid: alphabetic characters in year field' + data: YYYY-01-01 + valid: false diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/hostname.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/hostname.yml index 4d6ceedd..40425c45 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/hostname.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/hostname.yml @@ -60,10 +60,6 @@ - description: ends with hyphen data: hostname- valid: false - - 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 - valid: false - description: contains underscore data: host_name valid: false @@ -227,3 +223,7 @@ 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 valid: true + - 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 + valid: false diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/refOfUnknownKeyword.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/refOfUnknownKeyword.yml index 2efb59de..d3ebb6cb 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/refOfUnknownKeyword.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/refOfUnknownKeyword.yml @@ -53,7 +53,6 @@ - description: reference internals of known non-applicator schema: $schema: https://json-schema.org/draft/2019-09/schema - $id: /base examples: - type: string $ref: '#/examples/0' diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/propertyNames.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/propertyNames.yml index 9e4d12f1..37c2fe56 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/propertyNames.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/propertyNames.yml @@ -30,6 +30,12 @@ - description: ignores other non-objects data: 12 valid: true + - description: ignores null + data: null + valid: true + - description: ignores booleans + data: true + valid: true - description: propertyNames validation with pattern schema: $schema: https://json-schema.org/draft/2019-09/schema diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/unevaluatedProperties.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/unevaluatedProperties.yml index d71e6bb4..8eabe687 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/unevaluatedProperties.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/unevaluatedProperties.yml @@ -1137,3 +1137,44 @@ bar: foo bar: bar valid: false +- description: Evaluated properties collection needs to consider instance location with patternProperties + schema: + $schema: https://json-schema.org/draft/2019-09/schema + properties: + foo: + patternProperties: + ^bar$: + type: string + unevaluatedProperties: false + tests: + - description: with only the nested evaluated property + data: + foo: + bar: foo + valid: true + - description: with an unevaluated property that exists at another location + data: + foo: + bar: foo + bar: bar + valid: false +- description: Evaluated properties collection needs to consider instance location with additionalProperties + schema: + $schema: https://json-schema.org/draft/2019-09/schema + properties: + foo: + additionalProperties: + type: string + unevaluatedProperties: false + tests: + - description: with only the nested evaluated property + data: + foo: + bar: foo + valid: true + - description: with an unevaluated property that exists at another location + data: + foo: + bar: foo + bar: bar + valid: false diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/minProperties.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/minProperties.yml index de71d554..96330f21 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/minProperties.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/minProperties.yml @@ -24,6 +24,12 @@ - description: ignores other non-objects data: 12 valid: true + - description: ignores null + data: null + valid: true + - description: ignores booleans + data: true + valid: true - description: minProperties validation with a decimal schema: $schema: https://json-schema.org/draft/2020-12/schema diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/ecmascript-regex.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/ecmascript-regex.yml index 2e4892ab..e530c5c3 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/ecmascript-regex.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/ecmascript-regex.yml @@ -125,7 +125,7 @@ data: "\uFEFF" valid: true - description: line feed matches (line terminator) - data: |2+ + data: |+ valid: true - description: paragraph separator matches (line terminator) @@ -165,7 +165,7 @@ data: "\uFEFF" valid: false - description: line feed does not match (line terminator) - data: |2+ + data: |+ valid: false - description: paragraph separator does not match (line terminator) diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/date.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/date.yml index 8dfa6559..1d31d1cf 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/date.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/date.yml @@ -33,12 +33,6 @@ - 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 @@ -102,9 +96,6 @@ - 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 @@ -120,9 +111,6 @@ - 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 @@ -147,3 +135,74 @@ - description: an invalid time string in date-time format data: "2020-11-28T23:55:45Z" valid: false + - description: year 0000 is a leap year (0 % 400 == 0) + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case + data: "0000-02-29" + valid: true + - description: century year 0100 is not a leap year + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0 + data: 0100-02-29 + valid: false + - description: century year 0400 is a leap year + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary + data: "0400-02-29" + valid: true + - description: century year 2100 is not a leap year + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year + data: 2100-02-29 + valid: false + - description: 'invalid: leading whitespace is not permitted' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace + data: ' 2024-01-15' + valid: false + - description: 'invalid: trailing whitespace is not permitted' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace + data: '2024-01-15 ' + valid: false + - description: 'invalid: month 00 is not valid per date-month range 01-12' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12 + data: 2024-00-15 + valid: false + - description: 'invalid: day 00 is not valid per date-mday minimum of 01' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31 + data: 2024-01-00 + valid: false + - description: 'invalid: empty string' + data: "" + valid: false + - description: 'invalid: embedded whitespace between year and month' + data: 2020 -01-01 + valid: false + - description: 'invalid: trailing character after valid full-date' + data: 2020-01-01X + valid: false + - description: 'invalid: trailing Z after full-date' + data: 2020-01-01Z + valid: false + - description: 'invalid: full-date followed by space and time component' + data: 2020-01-01 00:00:00Z + valid: false + - description: 'valid: four-digit year 0001' + data: "0001-01-01" + valid: true + - description: 'invalid: two-digit year (N-2 digits)' + data: 20-01-01 + valid: false + - description: 'invalid: three-digit year (N-1 digits)' + data: 998-01-01 + valid: false + - description: 'invalid: five-digit year (N+1 digits)' + data: 12020-01-01 + valid: false + - description: 'invalid: positive sign prefix on year' + data: +2020-01-01 + valid: false + - description: 'invalid: negative sign prefix on year' + data: -2020-01-01 + valid: false + - description: 'invalid: non-ASCII Bengali digit in year field' + data: ২020-01-01 + valid: false + - description: 'invalid: alphabetic characters in year field' + data: YYYY-01-01 + valid: false diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/hostname.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/hostname.yml index 82b7df0b..19c63d31 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/hostname.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/hostname.yml @@ -60,10 +60,6 @@ - description: ends with hyphen data: hostname- valid: false - - 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 - valid: false - description: contains underscore data: host_name valid: false @@ -227,3 +223,7 @@ 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 valid: true + - 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 + valid: false diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/refOfUnknownKeyword.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/refOfUnknownKeyword.yml index ace04a63..80e5f53b 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/refOfUnknownKeyword.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/refOfUnknownKeyword.yml @@ -53,7 +53,6 @@ - description: reference internals of known non-applicator schema: $schema: https://json-schema.org/draft/2020-12/schema - $id: /base examples: - type: string $ref: '#/examples/0' diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/propertyNames.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/propertyNames.yml index eb9b1262..18f2eb8f 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/propertyNames.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/propertyNames.yml @@ -30,6 +30,12 @@ - description: ignores other non-objects data: 12 valid: true + - description: ignores null + data: null + valid: true + - description: ignores booleans + data: true + valid: true - description: propertyNames validation with pattern schema: $schema: https://json-schema.org/draft/2020-12/schema diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/unevaluatedProperties.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/unevaluatedProperties.yml index 570f12cd..2a613362 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/unevaluatedProperties.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/unevaluatedProperties.yml @@ -1103,3 +1103,44 @@ bar: foo bar: bar valid: false +- description: Evaluated properties collection needs to consider instance location with patternProperties + schema: + $schema: https://json-schema.org/draft/2020-12/schema + properties: + foo: + patternProperties: + ^bar$: + type: string + unevaluatedProperties: false + tests: + - description: with only the nested evaluated property + data: + foo: + bar: foo + valid: true + - description: with an unevaluated property that exists at another location + data: + foo: + bar: foo + bar: bar + valid: false +- description: Evaluated properties collection needs to consider instance location with additionalProperties + schema: + $schema: https://json-schema.org/draft/2020-12/schema + properties: + foo: + additionalProperties: + type: string + unevaluatedProperties: false + tests: + - description: with only the nested evaluated property + data: + foo: + bar: foo + valid: true + - description: with an unevaluated property that exists at another location + data: + foo: + bar: foo + bar: bar + valid: false diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft4/minProperties.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft4/minProperties.yml index 7eedaf3f..1b1206a7 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft4/minProperties.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft4/minProperties.yml @@ -23,3 +23,9 @@ - description: ignores other non-objects data: 12 valid: true + - description: ignores null + data: null + valid: true + - description: ignores booleans + data: true + valid: true diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft4/optional/ecmascript-regex.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft4/optional/ecmascript-regex.yml index 01e30cc3..eb1e52b8 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft4/optional/ecmascript-regex.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft4/optional/ecmascript-regex.yml @@ -116,7 +116,7 @@ data: "\uFEFF" valid: true - description: line feed matches (line terminator) - data: |2+ + data: |+ valid: true - description: paragraph separator matches (line terminator) @@ -155,7 +155,7 @@ data: "\uFEFF" valid: false - description: line feed does not match (line terminator) - data: |2+ + data: |+ valid: false - description: paragraph separator does not match (line terminator) diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft6/minProperties.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft6/minProperties.yml index a93d9869..6dde21cb 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft6/minProperties.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft6/minProperties.yml @@ -23,6 +23,12 @@ - description: ignores other non-objects data: 12 valid: true + - description: ignores null + data: null + valid: true + - description: ignores booleans + data: true + valid: true - description: minProperties validation with a decimal schema: minProperties: 1 diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft6/optional/ecmascript-regex.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft6/optional/ecmascript-regex.yml index 9c6e42ff..6c5f49c3 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft6/optional/ecmascript-regex.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft6/optional/ecmascript-regex.yml @@ -116,7 +116,7 @@ data: "\uFEFF" valid: true - description: line feed matches (line terminator) - data: |2+ + data: |+ valid: true - description: paragraph separator matches (line terminator) @@ -155,7 +155,7 @@ data: "\uFEFF" valid: false - description: line feed does not match (line terminator) - data: |2+ + data: |+ valid: false - description: paragraph separator does not match (line terminator) diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft6/propertyNames.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft6/propertyNames.yml index a91569ee..47989d6c 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft6/propertyNames.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft6/propertyNames.yml @@ -29,6 +29,12 @@ - description: ignores other non-objects data: 12 valid: true + - description: ignores null + data: null + valid: true + - description: ignores booleans + data: true + valid: true - description: propertyNames validation with pattern schema: propertyNames: diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/minProperties.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/minProperties.yml index a93d9869..6dde21cb 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/minProperties.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/minProperties.yml @@ -23,6 +23,12 @@ - description: ignores other non-objects data: 12 valid: true + - description: ignores null + data: null + valid: true + - description: ignores booleans + data: true + valid: true - description: minProperties validation with a decimal schema: minProperties: 1 diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/ecmascript-regex.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/ecmascript-regex.yml index 9c6e42ff..6c5f49c3 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/ecmascript-regex.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/ecmascript-regex.yml @@ -116,7 +116,7 @@ data: "\uFEFF" valid: true - description: line feed matches (line terminator) - data: |2+ + data: |+ valid: true - description: paragraph separator matches (line terminator) @@ -155,7 +155,7 @@ data: "\uFEFF" valid: false - description: line feed does not match (line terminator) - data: |2+ + data: |+ valid: false - description: paragraph separator does not match (line terminator) diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/format/date.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/format/date.yml index 738928ce..4c13bde5 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/format/date.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/format/date.yml @@ -32,12 +32,6 @@ - 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 @@ -101,9 +95,6 @@ - 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 @@ -119,9 +110,6 @@ - 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 @@ -146,3 +134,74 @@ - description: an invalid time string in date-time format data: "2020-11-28T23:55:45Z" valid: false + - description: year 0000 is a leap year (0 % 400 == 0) + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case + data: "0000-02-29" + valid: true + - description: century year 0100 is not a leap year + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0 + data: 0100-02-29 + valid: false + - description: century year 0400 is a leap year + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary + data: "0400-02-29" + valid: true + - description: century year 2100 is not a leap year + comment: https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year + data: 2100-02-29 + valid: false + - description: 'invalid: leading whitespace is not permitted' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace + data: ' 2024-01-15' + valid: false + - description: 'invalid: trailing whitespace is not permitted' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace + data: '2024-01-15 ' + valid: false + - description: 'invalid: month 00 is not valid per date-month range 01-12' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12 + data: 2024-00-15 + valid: false + - description: 'invalid: day 00 is not valid per date-mday minimum of 01' + comment: https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31 + data: 2024-01-00 + valid: false + - description: 'invalid: empty string' + data: "" + valid: false + - description: 'invalid: embedded whitespace between year and month' + data: 2020 -01-01 + valid: false + - description: 'invalid: trailing character after valid full-date' + data: 2020-01-01X + valid: false + - description: 'invalid: trailing Z after full-date' + data: 2020-01-01Z + valid: false + - description: 'invalid: full-date followed by space and time component' + data: 2020-01-01 00:00:00Z + valid: false + - description: 'valid: four-digit year 0001' + data: "0001-01-01" + valid: true + - description: 'invalid: two-digit year (N-2 digits)' + data: 20-01-01 + valid: false + - description: 'invalid: three-digit year (N-1 digits)' + data: 998-01-01 + valid: false + - description: 'invalid: five-digit year (N+1 digits)' + data: 12020-01-01 + valid: false + - description: 'invalid: positive sign prefix on year' + data: +2020-01-01 + valid: false + - description: 'invalid: negative sign prefix on year' + data: -2020-01-01 + valid: false + - description: 'invalid: non-ASCII Bengali digit in year field' + data: ২020-01-01 + valid: false + - description: 'invalid: alphabetic characters in year field' + data: YYYY-01-01 + valid: false diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/format/hostname.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/format/hostname.yml index 5f4616e1..db8e9897 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/format/hostname.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/optional/format/hostname.yml @@ -59,10 +59,6 @@ - description: ends with hyphen data: hostname- valid: false - - 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 - valid: false - description: contains underscore data: host_name valid: false @@ -225,3 +221,7 @@ 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 valid: true + - 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 + valid: false diff --git a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/propertyNames.yml b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/propertyNames.yml index a91569ee..47989d6c 100644 --- a/lib/src/testFixtures/resources/suite-yaml/tests/draft7/propertyNames.yml +++ b/lib/src/testFixtures/resources/suite-yaml/tests/draft7/propertyNames.yml @@ -29,6 +29,12 @@ - description: ignores other non-objects data: 12 valid: true + - description: ignores null + data: null + valid: true + - description: ignores booleans + data: true + valid: true - description: propertyNames validation with pattern schema: propertyNames: diff --git a/lib/src/testFixtures/resources/suite/tests/draft2019-09/minProperties.json b/lib/src/testFixtures/resources/suite/tests/draft2019-09/minProperties.json index 20e01a9e..48a2a59c 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2019-09/minProperties.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2019-09/minProperties.json @@ -35,6 +35,16 @@ "description": "ignores other non-objects", "data": 12, "valid": true + }, + { + "description": "ignores null", + "data": null, + "valid": true + }, + { + "description": "ignores booleans", + "data": true, + "valid": true } ] }, diff --git a/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/format/date.json b/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/format/date.json index 1ba5d9ca..77b5a8bf 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/format/date.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/format/date.json @@ -56,16 +56,6 @@ "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", @@ -171,11 +161,6 @@ "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", @@ -201,11 +186,6 @@ "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", @@ -245,6 +225,119 @@ "description": "an invalid time string in date-time format", "data": "2020-11-28T23:55:45Z", "valid": false + }, + { + "description": "year 0000 is a leap year (0 % 400 == 0)", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", + "data": "0000-02-29", + "valid": true + }, + { + "description": "century year 0100 is not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", + "data": "0100-02-29", + "valid": false + }, + { + "description": "century year 0400 is a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", + "data": "0400-02-29", + "valid": true + }, + { + "description": "century year 2100 is not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", + "data": "2100-02-29", + "valid": false + }, + { + "description": "invalid: leading whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": " 2024-01-15", + "valid": false + }, + { + "description": "invalid: trailing whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": "2024-01-15 ", + "valid": false + }, + { + "description": "invalid: month 00 is not valid per date-month range 01-12", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12", + "data": "2024-00-15", + "valid": false + }, + { + "description": "invalid: day 00 is not valid per date-mday minimum of 01", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31", + "data": "2024-01-00", + "valid": false + }, + { + "description": "invalid: empty string", + "data": "", + "valid": false + }, + { + "description": "invalid: embedded whitespace between year and month", + "data": "2020 -01-01", + "valid": false + }, + { + "description": "invalid: trailing character after valid full-date", + "data": "2020-01-01X", + "valid": false + }, + { + "description": "invalid: trailing Z after full-date", + "data": "2020-01-01Z", + "valid": false + }, + { + "description": "invalid: full-date followed by space and time component", + "data": "2020-01-01 00:00:00Z", + "valid": false + }, + { + "description": "valid: four-digit year 0001", + "data": "0001-01-01", + "valid": true + }, + { + "description": "invalid: two-digit year (N-2 digits)", + "data": "20-01-01", + "valid": false + }, + { + "description": "invalid: three-digit year (N-1 digits)", + "data": "998-01-01", + "valid": false + }, + { + "description": "invalid: five-digit year (N+1 digits)", + "data": "12020-01-01", + "valid": false + }, + { + "description": "invalid: positive sign prefix on year", + "data": "+2020-01-01", + "valid": false + }, + { + "description": "invalid: negative sign prefix on year", + "data": "-2020-01-01", + "valid": false + }, + { + "description": "invalid: non-ASCII Bengali digit in year field", + "data": "২020-01-01", + "valid": false + }, + { + "description": "invalid: alphabetic characters in year field", + "data": "YYYY-01-01", + "valid": false } ] } diff --git a/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/format/hostname.json b/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/format/hostname.json index 46304bc3..1c7fce1b 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/format/hostname.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/format/hostname.json @@ -101,12 +101,6 @@ "data": "hostname-", "valid": false }, - { - "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", - "valid": false - }, { "description": "contains underscore", "data": "host_name", @@ -355,6 +349,12 @@ "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", "valid": true + }, + { + "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", + "valid": false } ] } diff --git a/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/refOfUnknownKeyword.json b/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/refOfUnknownKeyword.json index 2db52308..a2437d31 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/refOfUnknownKeyword.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2019-09/optional/refOfUnknownKeyword.json @@ -69,7 +69,6 @@ "description": "reference internals of known non-applicator", "schema": { "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "/base", "examples": [ { "type": "string" } ], diff --git a/lib/src/testFixtures/resources/suite/tests/draft2019-09/propertyNames.json b/lib/src/testFixtures/resources/suite/tests/draft2019-09/propertyNames.json index 3b2bb23b..f4a7684d 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2019-09/propertyNames.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2019-09/propertyNames.json @@ -41,6 +41,16 @@ "description": "ignores other non-objects", "data": 12, "valid": true + }, + { + "description": "ignores null", + "data": null, + "valid": true + }, + { + "description": "ignores booleans", + "data": true, + "valid": true } ] }, diff --git a/lib/src/testFixtures/resources/suite/tests/draft2019-09/unevaluatedProperties.json b/lib/src/testFixtures/resources/suite/tests/draft2019-09/unevaluatedProperties.json index e18427c0..9bd9c6f3 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2019-09/unevaluatedProperties.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2019-09/unevaluatedProperties.json @@ -1651,5 +1651,65 @@ "valid": false } ] + }, + { + "description": "Evaluated properties collection needs to consider instance location with patternProperties", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "properties": { + "foo": { + "patternProperties": { + "^bar$": { "type": "string" } + } + } + }, + "unevaluatedProperties": false + }, + "tests": [ + { + "description": "with only the nested evaluated property", + "data": { + "foo": { "bar": "foo" } + }, + "valid": true + }, + { + "description": "with an unevaluated property that exists at another location", + "data": { + "foo": { "bar": "foo" }, + "bar": "bar" + }, + "valid": false + } + ] + }, + { + "description": "Evaluated properties collection needs to consider instance location with additionalProperties", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "properties": { + "foo": { + "additionalProperties": { "type": "string" } + } + }, + "unevaluatedProperties": false + }, + "tests": [ + { + "description": "with only the nested evaluated property", + "data": { + "foo": { "bar": "foo" } + }, + "valid": true + }, + { + "description": "with an unevaluated property that exists at another location", + "data": { + "foo": { "bar": "foo" }, + "bar": "bar" + }, + "valid": false + } + ] } ] diff --git a/lib/src/testFixtures/resources/suite/tests/draft2020-12/minProperties.json b/lib/src/testFixtures/resources/suite/tests/draft2020-12/minProperties.json index a753ad35..12587a5f 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2020-12/minProperties.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2020-12/minProperties.json @@ -35,6 +35,16 @@ "description": "ignores other non-objects", "data": 12, "valid": true + }, + { + "description": "ignores null", + "data": null, + "valid": true + }, + { + "description": "ignores booleans", + "data": true, + "valid": true } ] }, diff --git a/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/format/date.json b/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/format/date.json index 01731c34..97dbc3ec 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/format/date.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/format/date.json @@ -56,16 +56,6 @@ "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", @@ -171,11 +161,6 @@ "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", @@ -201,11 +186,6 @@ "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", @@ -245,6 +225,119 @@ "description": "an invalid time string in date-time format", "data": "2020-11-28T23:55:45Z", "valid": false + }, + { + "description": "year 0000 is a leap year (0 % 400 == 0)", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", + "data": "0000-02-29", + "valid": true + }, + { + "description": "century year 0100 is not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", + "data": "0100-02-29", + "valid": false + }, + { + "description": "century year 0400 is a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", + "data": "0400-02-29", + "valid": true + }, + { + "description": "century year 2100 is not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", + "data": "2100-02-29", + "valid": false + }, + { + "description": "invalid: leading whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": " 2024-01-15", + "valid": false + }, + { + "description": "invalid: trailing whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": "2024-01-15 ", + "valid": false + }, + { + "description": "invalid: month 00 is not valid per date-month range 01-12", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12", + "data": "2024-00-15", + "valid": false + }, + { + "description": "invalid: day 00 is not valid per date-mday minimum of 01", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31", + "data": "2024-01-00", + "valid": false + }, + { + "description": "invalid: empty string", + "data": "", + "valid": false + }, + { + "description": "invalid: embedded whitespace between year and month", + "data": "2020 -01-01", + "valid": false + }, + { + "description": "invalid: trailing character after valid full-date", + "data": "2020-01-01X", + "valid": false + }, + { + "description": "invalid: trailing Z after full-date", + "data": "2020-01-01Z", + "valid": false + }, + { + "description": "invalid: full-date followed by space and time component", + "data": "2020-01-01 00:00:00Z", + "valid": false + }, + { + "description": "valid: four-digit year 0001", + "data": "0001-01-01", + "valid": true + }, + { + "description": "invalid: two-digit year (N-2 digits)", + "data": "20-01-01", + "valid": false + }, + { + "description": "invalid: three-digit year (N-1 digits)", + "data": "998-01-01", + "valid": false + }, + { + "description": "invalid: five-digit year (N+1 digits)", + "data": "12020-01-01", + "valid": false + }, + { + "description": "invalid: positive sign prefix on year", + "data": "+2020-01-01", + "valid": false + }, + { + "description": "invalid: negative sign prefix on year", + "data": "-2020-01-01", + "valid": false + }, + { + "description": "invalid: non-ASCII Bengali digit in year field", + "data": "২020-01-01", + "valid": false + }, + { + "description": "invalid: alphabetic characters in year field", + "data": "YYYY-01-01", + "valid": false } ] } diff --git a/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/format/hostname.json b/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/format/hostname.json index 511995ae..8d721d92 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/format/hostname.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/format/hostname.json @@ -101,12 +101,6 @@ "data": "hostname-", "valid": false }, - { - "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", - "valid": false - }, { "description": "contains underscore", "data": "host_name", @@ -355,6 +349,12 @@ "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", "valid": true + }, + { + "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", + "valid": false } ] } diff --git a/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/refOfUnknownKeyword.json b/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/refOfUnknownKeyword.json index 8276affe..ab1510da 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/refOfUnknownKeyword.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2020-12/optional/refOfUnknownKeyword.json @@ -69,7 +69,6 @@ "description": "reference internals of known non-applicator", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "/base", "examples": [ { "type": "string" } ], diff --git a/lib/src/testFixtures/resources/suite/tests/draft2020-12/propertyNames.json b/lib/src/testFixtures/resources/suite/tests/draft2020-12/propertyNames.json index b4780088..84ca2b84 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2020-12/propertyNames.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2020-12/propertyNames.json @@ -41,6 +41,16 @@ "description": "ignores other non-objects", "data": 12, "valid": true + }, + { + "description": "ignores null", + "data": null, + "valid": true + }, + { + "description": "ignores booleans", + "data": true, + "valid": true } ] }, diff --git a/lib/src/testFixtures/resources/suite/tests/draft2020-12/unevaluatedProperties.json b/lib/src/testFixtures/resources/suite/tests/draft2020-12/unevaluatedProperties.json index a2507481..de6411ea 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft2020-12/unevaluatedProperties.json +++ b/lib/src/testFixtures/resources/suite/tests/draft2020-12/unevaluatedProperties.json @@ -1617,5 +1617,65 @@ "valid": false } ] + }, + { + "description": "Evaluated properties collection needs to consider instance location with patternProperties", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": { + "patternProperties": { + "^bar$": { "type": "string" } + } + } + }, + "unevaluatedProperties": false + }, + "tests": [ + { + "description": "with only the nested evaluated property", + "data": { + "foo": { "bar": "foo" } + }, + "valid": true + }, + { + "description": "with an unevaluated property that exists at another location", + "data": { + "foo": { "bar": "foo" }, + "bar": "bar" + }, + "valid": false + } + ] + }, + { + "description": "Evaluated properties collection needs to consider instance location with additionalProperties", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "foo": { + "additionalProperties": { "type": "string" } + } + }, + "unevaluatedProperties": false + }, + "tests": [ + { + "description": "with only the nested evaluated property", + "data": { + "foo": { "bar": "foo" } + }, + "valid": true + }, + { + "description": "with an unevaluated property that exists at another location", + "data": { + "foo": { "bar": "foo" }, + "bar": "bar" + }, + "valid": false + } + ] } ] diff --git a/lib/src/testFixtures/resources/suite/tests/draft4/minProperties.json b/lib/src/testFixtures/resources/suite/tests/draft4/minProperties.json index 49a0726e..ca473c02 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft4/minProperties.json +++ b/lib/src/testFixtures/resources/suite/tests/draft4/minProperties.json @@ -32,6 +32,16 @@ "description": "ignores other non-objects", "data": 12, "valid": true + }, + { + "description": "ignores null", + "data": null, + "valid": true + }, + { + "description": "ignores booleans", + "data": true, + "valid": true } ] } diff --git a/lib/src/testFixtures/resources/suite/tests/draft6/minProperties.json b/lib/src/testFixtures/resources/suite/tests/draft6/minProperties.json index 9f74f789..416e0201 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft6/minProperties.json +++ b/lib/src/testFixtures/resources/suite/tests/draft6/minProperties.json @@ -32,6 +32,16 @@ "description": "ignores other non-objects", "data": 12, "valid": true + }, + { + "description": "ignores null", + "data": null, + "valid": true + }, + { + "description": "ignores booleans", + "data": true, + "valid": true } ] }, diff --git a/lib/src/testFixtures/resources/suite/tests/draft6/propertyNames.json b/lib/src/testFixtures/resources/suite/tests/draft6/propertyNames.json index 7c7b8000..b8656431 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft6/propertyNames.json +++ b/lib/src/testFixtures/resources/suite/tests/draft6/propertyNames.json @@ -40,6 +40,16 @@ "description": "ignores other non-objects", "data": 12, "valid": true + }, + { + "description": "ignores null", + "data": null, + "valid": true + }, + { + "description": "ignores booleans", + "data": true, + "valid": true } ] }, diff --git a/lib/src/testFixtures/resources/suite/tests/draft7/minProperties.json b/lib/src/testFixtures/resources/suite/tests/draft7/minProperties.json index 9f74f789..416e0201 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft7/minProperties.json +++ b/lib/src/testFixtures/resources/suite/tests/draft7/minProperties.json @@ -32,6 +32,16 @@ "description": "ignores other non-objects", "data": 12, "valid": true + }, + { + "description": "ignores null", + "data": null, + "valid": true + }, + { + "description": "ignores booleans", + "data": true, + "valid": true } ] }, diff --git a/lib/src/testFixtures/resources/suite/tests/draft7/optional/format/date.json b/lib/src/testFixtures/resources/suite/tests/draft7/optional/format/date.json index 2cfdcf3f..f8909833 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft7/optional/format/date.json +++ b/lib/src/testFixtures/resources/suite/tests/draft7/optional/format/date.json @@ -53,16 +53,6 @@ "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", @@ -168,11 +158,6 @@ "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", @@ -198,11 +183,6 @@ "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", @@ -242,6 +222,119 @@ "description": "an invalid time string in date-time format", "data": "2020-11-28T23:55:45Z", "valid": false + }, + { + "description": "year 0000 is a leap year (0 % 400 == 0)", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", + "data": "0000-02-29", + "valid": true + }, + { + "description": "century year 0100 is not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", + "data": "0100-02-29", + "valid": false + }, + { + "description": "century year 0400 is a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", + "data": "0400-02-29", + "valid": true + }, + { + "description": "century year 2100 is not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", + "data": "2100-02-29", + "valid": false + }, + { + "description": "invalid: leading whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": " 2024-01-15", + "valid": false + }, + { + "description": "invalid: trailing whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": "2024-01-15 ", + "valid": false + }, + { + "description": "invalid: month 00 is not valid per date-month range 01-12", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12", + "data": "2024-00-15", + "valid": false + }, + { + "description": "invalid: day 00 is not valid per date-mday minimum of 01", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31", + "data": "2024-01-00", + "valid": false + }, + { + "description": "invalid: empty string", + "data": "", + "valid": false + }, + { + "description": "invalid: embedded whitespace between year and month", + "data": "2020 -01-01", + "valid": false + }, + { + "description": "invalid: trailing character after valid full-date", + "data": "2020-01-01X", + "valid": false + }, + { + "description": "invalid: trailing Z after full-date", + "data": "2020-01-01Z", + "valid": false + }, + { + "description": "invalid: full-date followed by space and time component", + "data": "2020-01-01 00:00:00Z", + "valid": false + }, + { + "description": "valid: four-digit year 0001", + "data": "0001-01-01", + "valid": true + }, + { + "description": "invalid: two-digit year (N-2 digits)", + "data": "20-01-01", + "valid": false + }, + { + "description": "invalid: three-digit year (N-1 digits)", + "data": "998-01-01", + "valid": false + }, + { + "description": "invalid: five-digit year (N+1 digits)", + "data": "12020-01-01", + "valid": false + }, + { + "description": "invalid: positive sign prefix on year", + "data": "+2020-01-01", + "valid": false + }, + { + "description": "invalid: negative sign prefix on year", + "data": "-2020-01-01", + "valid": false + }, + { + "description": "invalid: non-ASCII Bengali digit in year field", + "data": "২020-01-01", + "valid": false + }, + { + "description": "invalid: alphabetic characters in year field", + "data": "YYYY-01-01", + "valid": false } ] } diff --git a/lib/src/testFixtures/resources/suite/tests/draft7/optional/format/hostname.json b/lib/src/testFixtures/resources/suite/tests/draft7/optional/format/hostname.json index 32e103d1..d9da0fcc 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft7/optional/format/hostname.json +++ b/lib/src/testFixtures/resources/suite/tests/draft7/optional/format/hostname.json @@ -98,12 +98,6 @@ "data": "hostname-", "valid": false }, - { - "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", - "valid": false - }, { "description": "contains underscore", "data": "host_name", @@ -349,6 +343,12 @@ "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", "valid": true + }, + { + "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", + "valid": false } ] } diff --git a/lib/src/testFixtures/resources/suite/tests/draft7/propertyNames.json b/lib/src/testFixtures/resources/suite/tests/draft7/propertyNames.json index 7c7b8000..b8656431 100644 --- a/lib/src/testFixtures/resources/suite/tests/draft7/propertyNames.json +++ b/lib/src/testFixtures/resources/suite/tests/draft7/propertyNames.json @@ -40,6 +40,16 @@ "description": "ignores other non-objects", "data": 12, "valid": true + }, + { + "description": "ignores null", + "data": null, + "valid": true + }, + { + "description": "ignores booleans", + "data": true, + "valid": true } ] },