Skip to content

fix(jsonschema): remove meta-schema validation and the validator dependency - #742

Merged
daveshanley merged 1 commit into
mainfrom
claude/libopenapi-jsonschema-validation-52a45b
Nov 30, 2026
Merged

daveshanley merged 1 commit into
mainfrom
claude/libopenapi-jsonschema-validation-52a45b

Conversation

@daveshanley

Copy link
Copy Markdown
Member

Summary

  • Removes jsonschema/validation.go and its call in addSource. Loading a schema no longer runs it against the Draft 2020-12 meta-schema, which is libopenapi-validator's job.
  • Drops github.com/pb33f/jsonschema/v6 (and the indirect golang.org/x/text) from go.mod.
  • Removes the tests that only covered meta-validation. The collection MemberError check stays, renamed TestCollectionMemberErrorNamesTheSource, with an input that still fails to load.
  • TestDocument_SiblingRefUnevaluatedKeywordsKeepResourceScope keeps its rendered-output assertions but no longer compiles the result with a validator.
  • Keeps the YAML number retag in 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} or minLength: -2) now load instead of failing.

Test plan

  • go test ./...
  • jsonschema package coverage at 100%

🤖 Generated with Claude Code

…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

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6aaf03b) to head (59b054f).

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     
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@daveshanley
daveshanley merged commit bc0b04a into main Nov 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant