Repository navigation
Generate request-response models when only map keywords of a model reach a readOnly model - #5220
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. |
5ff0d67 to
33d6b4e
Compare
Merging this PR will degrade performance by 47.75%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
…ach a readOnly model Under --read-only-write-only-model-type request-response the schema graph that decides which models get Request/Response variants followed patternProperties and propertyNames everywhere. Beside properties or allOf, and in an inline allOf member, the object is a model whose fields hold its properties alone, and propertyNames give no keys where patternProperties do, so those keywords type nothing there. Such a model did not split while the references to it read variants that were never generated, and generation failed with "A Parser can not resolve classes". The graph now reads those keywords only where they type an object map: the model and the models inheriting from it or referencing it keep one class, as without the option, and only the readOnly model splits. The schema graph check test reads a schema whose patternProperties sit beside a $ref, which still splits this way. Fixes: #5097
33d6b4e to
b261839
Compare
Breaking Change AnalysisResult: No breaking changes detected Reasoning: The only source change is internal to the JSON Schema parser in the read-only/write-only request-response schema graph walk. The private helper _iter_rw_model_schema_children gets a new keyword argument types_map and now yields a merged flag. _get_ref_schema_rw_model_reference_facts no longer counts patternProperties or propertyNames as type-contributing when they sit beside properties or allOf, inside an inline allOf member, or, for propertyNames, when patternProperties already give the keys. This is a bug fix. Before, the schema graph said these objects needed Request/Response variants even though their generated models have no field holding those map values. The project's own schema-graph consistency check flagged this as an error: the model does not split, but its references read a variant. The updated check fixture shows that the previously flagged pattern_properties_base case is now consistent. Generated output only changes for users of the request-response read-only/write-only mode with these specific map-keyword shapes, and the old output there was the inconsistency the check was built to catch. No CLI options, public API, templates, defaults, Python version support or error reporting changed. The rest of the diff is new test fixtures, expected outputs and test updates that call the private helper. This analysis was produced by the release draft workflow |
Fixes: #5097
Summary by CodeRabbit
Bug Fixes
Tests