Merged
Conversation
c9f2cfa to
3b0e126
Compare
2c01b5c to
c1510d5
Compare
There was a problem hiding this comment.
Pull request overview
Adds an optional jsonschema-rs-powered schema validation backend to improve performance, with environment-based selection and CI coverage to ensure both backends behave acceptably within this codebase.
Changes:
- Introduces backend selection (
auto/jsonschema/jsonschema-rs) viaOPENAPI_SPEC_VALIDATOR_SCHEMA_VALIDATOR_BACKENDand wires it into schema validator construction. - Adds a
jsonschema-rsadapter layer and updates CLI behavior/output for backend-specific subschema-details handling. - Updates tests/docs/CI to support both backends and loosen assertions where error strings differ.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| openapi_spec_validator/settings.py | Adds settings field + normalization for backend selection. |
| openapi_spec_validator/schemas/backend/init.py | Implements backend selection logic and validator factory routing. |
| openapi_spec_validator/schemas/backend/jsonschema.py | Adds a small factory for the Python jsonschema backend. |
| openapi_spec_validator/schemas/backend/jsonschema_rs.py | Adds the Rust adapter/wrapper and validator factory. |
| openapi_spec_validator/schemas/init.py | Switches schema validator proxies to use backend factories and exposes backend selection. |
| openapi_spec_validator/main.py | Gates subschema detail printing based on backend support. |
| tests/integration/validation/test_exceptions.py | Makes error-message assertions backend-agnostic (substring-based). |
| tests/integration/test_main.py | Adjusts CLI-output assertions to handle backend differences and adds a backend-gating test. |
| tests/integration/test_shortcuts.py | Adds tests for env-driven backend selection and module behavior. |
| tests/bench/runner.py | Prints configured/effective backend in benchmark output. |
| docs/python.rst | Documents backend selection env var. |
| docs/cli.rst | Notes backend selection env var for CLI usage. |
| README.rst | Documents backend selection env var in performance tuning section. |
| .github/workflows/python-tests.yml | Runs test matrix for both jsonschema and jsonschema-rs backends. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Contributor
…, install docs, validate_formats Co-authored-by: p1c2u <1679024+p1c2u@users.noreply.github.com>
Address jsonschema-rs backend review feedback
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.
Benchmarks:
Result:
Where the win comes from:
Cost introduced by Rust path is small in profile:
Relates #477