Repository navigation
Conversation
Move completion, hover and validation to the v10 compileSchema API. v10 keeps sibling keywords next to $ref, so a $ref combined with a oneOf of consts now offers those values as completions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
json-schema-library validates "if" against a copy of the validation path so the nodes it evaluates aren't recorded. The path holds every node visited so far and is never trimmed, so each "if" costs time proportional to everything validated before it and validation is quadratic in document size. Schemas that select definitions with if/then took ~30s on a 380KB document and crashed the tab at 2MB. v10 and v11 are both affected. Compile schemas with drafts whose "if" validator uses the shared path and truncates it afterwards, which discards the same entries without the copy and keeps the dynamic scope for $dynamicRef and $recursiveRef. All features now compile through utils/compile-schema. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for codemirror-json-schema ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 3505836 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This was referenced Oct 27, 2026
json-schema-library v10 validators return errors only, and its unevaluatedProperties re-runs "if" to find the evaluated branch, so the wrapper's results match the library's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Upgrades
json-schema-libraryfrom v9 to v10 and fixes a performance problem that v10 introduces.This is the first of three PRs from the Invopop fork, which publishes these changes as
@invopop/codemirror-json-schema. The other two build on this one.Upgrade (2d84674)
compileSchemaAPI instead ofDraft07.$ref, so a$refcombined with aoneOfof consts now offers those values as completions (new test).oneOfoption, for example#/definitions/fancyObject (object), and object completions reportobjectas their detail. The tests are updated to match.Linear
if/then/elsevalidation (5da40bd)v10 validates
ifagainst a copy of the validation path ([...path]). That path holds every node visited so far and is never trimmed, so eachifcosts time proportional to everything validated before it, and validation becomes quadratic in document size. v11 (11.6.16) behaves the same.Schemas that pick a definition by testing a discriminator with
if/thenare hit hardest. Linting a document with ~30 such conditions per node:src/utils/compile-schema.tswrapscompileSchemawith the default drafts, but replaces theifvalidator. It validatesifagainst the shared path and then truncates the path back to its previous length, which discards the same entries without the copy.$dynamicRefand$recursiveRefinsideifstill see the full dynamic scope, and a test checks this. Another test fails on the unpatched library: 8× the nodes took 76× the time. A third checks that properties evaluated bythen/elsestill count forunevaluatedProperties. I'll also report the problem to json-schema-library, so the wrapper can be removed once it's fixed there.Notes
pnpm test(138 tests),pnpm tscandpnpm buildpass.🤖 Generated with Claude Code