Repository navigation
Move the schema validator planning of the JSON Schema parser into a module of its own - #5632
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Schema validation helpers and rule registration src/datamodel_code_generator/parser/_schema_validators.py, docs/architecture.md, scripts/decision_homes.toml |
The new module defines schema traversal, compatibility, input-name mapping, and runtime-rule registration helpers. The architecture note and signature-scan paths are updated to reference the module. |
JSON Schema parser delegation src/datamodel_code_generator/parser/jsonschema.py |
The parser delegates schema validation operations to the new module and removes the corresponding inline implementations. Import annotations preserve selected parser-module exports. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Refactor
Merge Risk: 
Minimal · previous review c523d
-
No actionable merge-blocking issue is established for the validator-module extraction. Mergeability remains subject to normal checks.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 89.58% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 48 functions across 1 files. (3 skipped: 2 unsupported, 1 too large.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merging this PR will improve performance by 22.59%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
c523deb to
6702899
Compare
6702899 to
e664ae2
Compare
Breaking Change AnalysisResult: No breaking changes detected Reasoning: This PR is a pure refactor that moves the schema validator rule logic for --generate-schema-validators out of parser/jsonschema.py into a new private module parser/_schema_validators.py, with JsonSchemaParser keeping thin delegating methods; a line-by-line comparison of the removed and added code shows identical logic (required groups, conditional rules, property counts, uniqueItems paths, patternProperties intersection proofs, input-name resolution). The only removals are underscore-prefixed private internals such as _get_not_required_groups, _has_required_group_validators, _has_conditional_validator, _has_core_schema_runtime_rules, _field_alias_generator_input_name, _schema_may_accept_container, the pattern-proof classmethods, _add_group_validators and the module-level _input_names helper, none of which are public API; previously used imports in parser.jsonschema are explicitly preserved as re-exports. Doc and decision_homes.toml edits only update internal references. The behaviour diff gate accepted cells all concern allOf schemas whose parts admit no object becoming root models or aliases, and its notes attribute them to an earlier allOf change measured against the last release; nothing in this diff touches that logic, so they are not attributable to this PR. No CLI options, defaults, templates, Python version support or error handling changed. This analysis was produced by the release draft workflow |
|
🎉 Released in 0.88.0 This PR is now available in the latest release. See the release notes for details. |
Summary by CodeRabbit
Refactor
Documentation