You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decide a branch's object exclusion by one predicate - #6776
refactor-object-exclusion-predicatedatamodel-code-generator/datamodel-code-generator:refactor-object-exclusion-predicateCopy head branch name to clipboard
refactor-object-exclusion-predicatedatamodel-code-generator/datamodel-code-generator:refactor-object-exclusion-predicateCopy head branch name to clipboard
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
When read_object_keywords_by_type is enabled, _combined_branch_outer now uses _branch_excludes_objects as its object-exclusion check for inline branches.
_combined_branch_outer now uses _branch_excludes_objects instead of a separate _types_exclude check for inline branches when read_object_keywords_by_type is enabled.
This is a small internal refactor of how the parser decides whether a branch excludes objects. No behavior change or concrete risk has been identified, so it is ready to merge after normal checks.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title states the main change: an inline branch's object exclusion is now decided by a single predicate, _branch_excludes_objects. The raw summary confirms _combined_branch_outer now uses that …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title states the main change: an inline branch's object exclusion is now decided by a single predicate, _branch_excludes_objects. The raw summary confirms _combined_branch_outer now uses that predicate as its sole object-exclusion check and no longer takes the separate _types_exclude path. The title is specific and matches the one-file change (+1/-3).
Finishing Touches
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.
Reviewing files that changed from the base of the PR and between ad730f3 and 982c7a0.
Files selected for processing: 1
src/datamodel_code_generator/parser/jsonschema.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
⚠️52 benchmarks with a significant change ran on different hardware
Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.
Reasoning: The PR changes a single condition in JsonSchemaParser in parser/jsonschema.py. The old check was a types-exclude-object test, or a ref branch that excludes objects. The new check calls only the _branch_excludes_objects helper. Both versions run only when the read_object_keywords_by_type config is enabled, so the change stays behind that option and only adjusts which branches drop object-only keywords. No CLI option, Python API, template, Python version support or error handling changed. The behaviour diff gate lists only both-fail cells, with no accepted or violation cells, so default generated output is identical to release 0.95.0. This looks like an internal refinement or bug fix, not a breaking change.
This analysis was produced by the release draft workflow
This PR is now available in the latest release. See the release notes for details.
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
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 by CodeRabbit