Repository navigation
Move the object map reading of the JSON Schema parser into a module of its own - #5631
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 |
|---|---|
Object-map contracts and additional-properties helpers src/datamodel_code_generator/parser/_object_maps.py |
The new module defines the ObjectMapsHost protocol and helpers for typed additional-property fields, eligible allOf merging, additional-properties maps, and nullable maps. |
Pattern-map and property-name parsing src/datamodel_code_generator/parser/_object_maps.py |
The module adds pattern-map construction, property-name key parsing, property-name maps, and object-map nullability checks. |
Parser delegation and helper references src/datamodel_code_generator/parser/jsonschema.py, src/datamodel_code_generator/parser/_null_facts.py, docs/architecture.md, scripts/decision_homes.toml |
JsonSchemaParser delegates object-map operations to the new module. Documentation and decision-home entries identify the extracted helpers. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Merge Risk: 
Minimal · previous review 122d7
-
No actionable merge-blocking issue is established for this extraction; merge after normal checks pass.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% 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 18 functions across 2 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 not alter performance1 warning
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
122d7d1 to
a7ec20f
Compare
a7ec20f to
9c4e6e2
Compare
Breaking Change AnalysisResult: No breaking changes detected Reasoning: This PR is a pure internal refactor that moves the object map helpers of the JSON Schema parser into a new module parser/_object_maps.py with logic unchanged line for line; only private underscore-prefixed parser methods and private module-level helpers are removed from parser/jsonschema.py, while the public hooks parse_pattern_properties and parse_property_names stay on JsonSchemaParser as delegators, _legacy_object_maps stays cached on the parser, _typed_nullable_map_value_schema and _other_keys_schema remain as delegators, and literal_pattern_value stays exported from parser.jsonschema; the remaining changes are documentation and decision_homes.toml path updates, with no CLI option, default, template, Python version or error handling changes; the accepted behaviour diff cells all concern an allOf whose parts admit no object becoming a root model, logic this diff does not touch, so they reflect other changes merged since the last release rather than this PR, and the crash-fix and both-fail cells do not change default output. 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
allOfschemas.