馃悰 fix(schema): declare prefix in the labeled factor group's not clause - #4051
Merged
gaborbernat merged 2 commits intoAug 28, 2026
Merged
Conversation
SchemaStore compiles the published schema with ajv strict mode, which
refuses a `required` naming a property the schema never declares. The
labeled factor group has said `not: {required: [prefix]}` since April to
keep a bare range dict from reading as a label, and ajv had been
satisfied by `prefix` reaching it from an inlined sibling. Adding the
range and values shapes to its `additionalProperties` in 4.61 changed
how ajv inlines, the property stopped arriving, and the release sync PR
failed to compile.
Declaring `prefix` inside the `not` with an empty schema names it for
strict mode while constraining nothing, so validation is unchanged. The
new test walks the committed schema for the same defect, since neither
the freshness check nor the tombi lint compiles the schema this way.
The schema reached SchemaStore only on a release tag, and nothing on the way there compiled it the way SchemaStore does: the freshness test compares generator output against the committed file, and the tombi tests validate TOML documents rather than the schema itself. A schema that ajv strict mode rejects therefore surfaced as a failed sync pull request after the release had shipped. The sync workflow now clones SchemaStore, stages tox's schema and runs their checker for it, on every pull request touching the schema and again before the release sync opens a pull request.
gaborbernat
force-pushed
the
fix-schema-strict-required
branch
from
August 28, 2026 22:42
7e6b28f to
f6e47a7
Compare
gaborbernat
marked this pull request as ready for review
August 28, 2026 22:46
gaborbernat
enabled auto-merge (squash)
August 28, 2026 22:46
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.
The JSON Schema tox publishes for editors stopped compiling under SchemaStore's validator, so the 4.61.0 sync failed and editors still get the schema from 4.56.0 (SchemaStore/schemastore#6265).
The rule that keeps a bare range from reading as a labeled factor group had a form their validator tolerated by luck. Giving labeled groups ranges and value tables in 4.61 tipped it over. The rule now takes a form they accept, and what the schema allows does not change: a labeled list, a labeled range, a labeled values table, a bare range dict and a two-key table each validate as before.
Nothing on the way to a release compiled the schema the way SchemaStore does, so this could only appear after the tag shipped. Every pull request that changes the schema now runs it through their validator, and the release sync runs it again before opening a pull request there, so a schema they would reject can no longer reach a release.