Repository navigation
fix(jsonschema): remove meta-schema validation and the validator dependency - #742
Merged
Merged
Conversation
…ndency Loading a native JSON Schema no longer validates it against the Draft 2020-12 meta-schema. Validation belongs in libopenapi-validator, and it made github.com/pb33f/jsonschema/v6 a runtime dependency of libopenapi. The meta-validation tests go with it. The sibling-ref test keeps its rendered-output assertions but no longer compiles the result with a validator, so the dependency leaves go.mod entirely. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #742 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 325 324 -1
Lines 41784 41718 -66
=========================================
- Hits 41784 41718 -66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
jsonschema/validation.goand its call inaddSource. Loading a schema no longer runs it against the Draft 2020-12 meta-schema, which is libopenapi-validator's job.github.com/pb33f/jsonschema/v6(and the indirectgolang.org/x/text) fromgo.mod.MemberErrorcheck stays, renamedTestCollectionMemberErrorNamesTheSource, with an input that still fails to load.TestDocument_SiblingRefUnevaluatedKeywordsKeepResourceScopekeeps its rendered-output assertions but no longer compiles the result with a validator.datamodel/schema_node.go. It preserves numeric types for out-of-range numbers and has its own parser test.Behaviour change
Schemas that are invalid against the meta-schema (for example
{"type":42}orminLength: -2) now load instead of failing.Test plan
go test ./...jsonschemapackage coverage at 100%🤖 Generated with Claude Code