Repository navigation
Conversation
Roman3349
force-pushed
the
feat/draft-04-strict-mode
branch
from
November 25, 2026 07:43
5376843 to
9cb1450
Compare
6 of 12 tasks
Roman3349
force-pushed
the
feat/draft-04-strict-mode
branch
2 times, most recently
from
November 27, 2026 15:47
458b410 to
dd06351
Compare
…RFC 3986 and RFC 5321 Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
… address literals Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
Roman3349
force-pushed
the
feat/draft-04-strict-mode
branch
from
December 4, 2026 14:37
dd06351 to
3e81507
Compare
…t mode on 32 bits Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CHECK_MODE_STRICTcould not be used with Draft-04 schemas. The validator looked up adraft04constraint that did not exist and threwUnknown constraint draft04, so Draft-04 schemas could only be validated by the legacy constraints.This adds a Draft-04 constraint set for the strict mode. Following the existing pattern, the classes are full copies of the Draft-06 classes, not subclasses, and no Draft-06 or later file is changed. Without
CHECK_MODE_STRICT, Draft-04 schemas are still validated by the legacy constraints.The copies only differ from Draft-06 where the Draft-04 specification does:
const,contains,propertyNamesand the numericexclusiveMinimum/exclusiveMaximumkeywords do not exist in Draft-04 and are not part of the set.exclusiveMinimum/exclusiveMaximumare boolean modifiers ofminimum/maximum(validation §5.1.2, §5.1.3). Withoutminimum/maximumthey are ignored. A failed exclusive bound is reported asexclusiveMinimum/exclusiveMaximum.integeris a JSON number without a fraction or exponent part (core §3.5), so a float such as1.0is not an integer.CHECK_MODE_VALIDATE_SCHEMAis set.Changes:
Constraints\Drafts\Draft04: new constraint set, itsFactoryand thedraft04entry inConstraints\Factory.JsonSchemaTestSuiteTest: the Draft-04 test suite runs in strict mode too, next to the existing run with the legacy constraints. The strict mode run has its own skips, 17 cases (bignum, float overflow, zero-width whitespace in\sand the knownformatgaps of the other drafts). All of them are skipped for the legacy constraints too. Another 26 cases that are skipped for the legacy constraints pass in strict mode: 24 ECMA 262 regex cases andmultipleOfwith a small and a large number.tests/Constraints/Draft04, plusDraft04ConstraintTestfor the Draft-04 specific behavior. Draft-04 is added to the strict mode cases inSchemaValidationTestand removed from the drafts without strict mode support inValidatorTest.README.md: Draft-4 is listed in theCHECK_MODE_STRICTfootnote.Related Issue
None
Type of Change
Checklist
Additional Notes
This PR also contains the commits of other open PRs, so that Draft-04 in strict mode gets their fixes too. The last commit applies them to the Draft-04 classes and removes the strict mode skips that pass now:
patternandpatternPropertiesin the non-strict mode, and the exact ECMA 262\sand\S.uri,uri-referenceandemailformats as defined by RFC 3986 and RFC 5321.Once those are merged, their commits drop out of this PR when it is rebased. With them, 4 cases are skipped for Draft-04 in strict mode (bignum, float overflow and the overall length of a hostname), instead of the 17 listed above.