Repository navigation
Choose the parse method for every schema position from one table - #5158
Conversation
|
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. |
Merging this PR will regress 1 benchmark2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Breaking Change AnalysisResult: No breaking changes detected Reasoning: This PR is an internal refactor of how the parser dispatches schema objects. It adds a private module, parser/_schema_dispatch.py, with ordered dispatch tables for three schema positions: definition, field and OpenAPI operation. It then rewrites the private methods _parse_schema_obj, _parse_schema_item_shape and _parse_object_kind_schema, plus OpenAPIParser.parse_schema, so each looks up its parse method in one of these tables. The tables check the same conditions in the same order as the old if/elif chains. The rows still call the public hooks (parse_array, parse_all_of, parse_one_of, parse_any_of, parse_object, parse_enum, parse_root_type, parse_ref, get_data_type) through the parser, so subclasses that override those hooks keep working. Public method signatures are unchanged. _parse_constrained_type_union is kept and now delegates to two new helpers with equivalent logic. No CLI options, config fields, templates, defaults or Python version support change. The only new runtime behavior is an extra violation of kind dispatch under the opt-in DATAMODEL_CODE_GENERATOR_CHECK_SCHEMA_GRAPH developer check, which compares each table choice with the old dispatch. The new test fixtures (an allOf request body, a oneOf body beside properties, a parameter without a name) cover branches that were previously marked no cover. They do not show any change to generated output. The remaining changes are documentation and the architecture-boundary list, so nothing here breaks existing users. This analysis was produced by the release draft workflow |
Summary by CodeRabbit
allOfandoneOfschemas with object properties.oneOfmember types are unavailable.