Repository navigation
Split a request-response model that re-declares the flagged property of an allOf ancestor - #5221
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
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. |
9af87ef to
0d3e071
Compare
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
…of an allOf ancestor Under --read-only-write-only-model-type request-response a model split only where its effective fields were flagged or referenced a model with variants. A child that re-declares the inherited readOnly property (through a $ref, or inline under --allof-merge-mode none), or the inherited reference to a model with variants, has no such field, so it was written as a subclass of an ancestor whose model the variants replace, while the fields referencing it read variants that were never generated, and generation failed with "A Parser can not resolve classes". Such a model now also splits where the effective fields of an allOf ancestor split it; its variants keep the re-declared property, and the fields referencing it read them. Fixes: #5132
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
0d3e071 to
038cdd0
Compare
Breaking Change AnalysisResult: No breaking changes detected Reasoning: The only source change is a refactor and bug fix in the JSON Schema parser's _get_separate_model_fields. The repeated split check is moved into two new private helpers, _rw_model_fields_split and _splits_into_rw_model_variants. With the request-response read-only/write-only model type, a model now also splits into Request and Response variants when one of its allOf ancestors splits, even if the model re-declares the inherited flagged property. Before this fix, such a model could not inherit from the ancestor, because the variants replace the ancestor's model, so the old output for these schemas was broken. The change only applies when the opt-in read-only-write-only-model-type option is set to request-response. No CLI options, public Python APIs, template variables, defaults or supported Python versions are changed or removed. The deleted lines are only the inline condition logic that moved into the helpers. Everything else in the PR is new test fixtures, expected outputs and test registrations. So this is a bug fix that makes previously invalid output correct, not a breaking change. This analysis was produced by the release draft workflow |
Fixes: #5132
Summary by CodeRabbit
Bug Fixes
Tests