Repository navigation
Conversation
Roman3349
force-pushed
the
feat/draft-2020-12
branch
from
October 14, 2026 20:54
61bcf04 to
6d8fb3e
Compare
Add basic support for Draft 2020-12 based on the Draft 2019-09 implementation, including the mandatory prefixItems/items changes and a bundled meta-schema. Draft 2020-12 requires format assertion to be disabled by default. Add CHECK_MODE_FORMAT_ASSERTION to opt in, CHECK_MODE_DISABLE_FORMAT takes precedence when both are set. Other drafts are not affected. Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
Roman3349
force-pushed
the
feat/draft-2020-12
branch
from
October 14, 2026 21:05
6d8fb3e to
7b5a541
Compare
… error message The pattern constraints of Draft 2020-12 passed "found" as the first error parameter, so the message template "Does not match the regex pattern %s" was filled with the validated value instead of the pattern. 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
Adds basic support for Draft 2020-12, based on the Draft 2019-09 implementation. Only changes required by the 2020-12 specification are made. The motivation was to add the draft 2020-12 to validate the OpenAPI specification v3.1, which is a subset of the draft 2020-12.
Draft2020constraint set (copied fromDraft2019) and adraft2020-12dialect registered inFactory.prefixItems/itemsas required by 2020-12:additionalItemsis removed and the array form ofitemsis replaced byprefixItems.PrefixItemsConstraintvalidates array items by position.itemsnow takes a single schema and only applies to items after those covered byprefixItems.dist/schema/json-schema-draft-2020-12.json, plus its URL mapping inUriRetriever.formatis an annotation by default, as 2020-12 requires (§7.2.1: assertion "MUST be disabled by default"). The newConstraint::CHECK_MODE_FORMAT_ASSERTIONflag enables it.CHECK_MODE_DISABLE_FORMATwins if both flags are set. Other drafts are not affected.draft2020-12in strict mode. Theoptional/formattests run withCHECK_MODE_FORMAT_ASSERTIONenabled.Same limitations as Draft 2019-09, and the matching test cases are skipped:
$dynamicRef/$dynamicAnchorare not supported (the successors of$recursiveRef/$recursiveAnchor, which aren't supported in 2019-09 either).unevaluatedItems/unevaluatedPropertiesare not supported.$vocabularyis not supported (optional/format-assertion.json).Related Issue
Type of Change
Checklist
Additional Notes