Repository navigation
Decide the effective parameters and security of an operation and read a parameter's location in one place each - #5756
Conversation
… a parameter's location in one place each
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Parameter place contract and consumers src/datamodel_code_generator/_target_contract.py, src/datamodel_code_generator/_client/plan.py, src/datamodel_code_generator/_client/protocol_plan.py, src/datamodel_code_generator/_fastapi/plan.py, src/datamodel_code_generator/_openapi_wire_plan.py, src/datamodel_code_generator/_target_operations.py, scripts/decision_homes.toml |
parameter_location and parameter_place provide parameter location and wire-name information. Client, FastAPI, wire-planning, and target-operation code use these helpers. Decision-home rules record parameter-location ownership and the paths-scope override behavior. |
Effective operation parameters and security src/datamodel_code_generator/_openapi_paths.py, src/datamodel_code_generator/parser/openapi.py, src/datamodel_code_generator/parser/openapi_scope.py, src/datamodel_code_generator/_target_binding.py, docs/architecture.md, scripts/decision_homes.toml |
Shared helpers merge operation parameters with inherited parameters and determine inherited security. The parser and scope walk use the helpers to build effective operations, and target binding uses the inherited-security helper. Documentation describes the inheritance rules and paths-scope header-name behavior. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Sequence Diagram(s)
sequenceDiagram
participant OpenAPIParser
participant effective_parameters
participant effective_operation
participant _walk_api_operation
OpenAPIParser->>effective_parameters: Merge operation and inherited parameters
OpenAPIParser->>effective_operation: Add effective parameters and inherited security
_walk_api_operation->>effective_parameters: Merge operation and common parameters
_walk_api_operation->>effective_operation: Add effective parameters and API-level security
Merge Risk: 
Minimal · up to b3e23
-
The change centralizes existing parameter and security decisions. No actionable merge-blocking risk is established; merge after normal checks pass.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 80.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 15 functions across 10 files. (2 skipped: 2 unsupported.)
-
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.
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! |
Breaking Change AnalysisResult: No breaking changes detected Reasoning: This PR is an internal refactor that moves existing logic into shared helpers without changing behaviour. In _openapi_paths.py it adds effective_parameters, inherited_security and effective_operation, and in _target_contract.py it adds parameter_location and parameter_place. The paths-scope walk in parser/openapi.py, the API walk in parser/openapi_scope.py, the target binding, the wire plan, the client and FastAPI planners, and the placeholder checks now call these helpers instead of repeating the code inline. Each replacement keeps the old semantics. Parameter overrides still use the same keys: the paths-scope walk overrides by name as written, and the API walk folds header names through parameter_key. An operation is still copied only when its path item has parameters or it inherits security. Security is inherited only when the raw operation does not declare its own. Location and wire-name lookups still go through the same LOCATIONS mapping and the same name-or-empty fallback. The only removed lines are imports of the private LOCATIONS name in internal modules, inline code that was replaced, and documentation text. No CLI options, public API, templates, defaults, Python version support or error reporting change. The new legacy-case-sensitive-parameter-override row only records existing behaviour. The accepted cells in the behaviour diff are all about allOf parts that admit no object becoming root models, which this diff does not touch, so they come from other changes since the last release. 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