Repository navigation
Report component names that are not strings as schema errors - #5230
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29b47481f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Merging this PR will degrade performance by 10.49%1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
A YAML key such as `1` under `components` loads as a number. The legacy scopes crashed on such a name under `schemas` and `requestBodies`, and the `api` scope on every component kind it reads (and on any loaded document's `schemas`). They now stop with "Error at schema path '<doc>#/components/<kind>/1': component name 1 is not a string". Runs that never use such a name as a model name, such as a legacy request body without a schema, keep their output. Boolean schemas in `allOf` no longer crash since #5159. Fixes: #4491
29b4748 to
a699f8e
Compare
Breaking Change AnalysisResult: No breaking changes detected Reasoning: The PR adds two internal helpers to the OpenAPI parser, _component_name and _named_components. They check that every key under components schemas, requestBodies, parameters, responses, headers, pathItems and callbacks is a string. A key like an unquoted YAML 1, which loads as a number, now raises a SchemaParseError that names the component location and says the component name is not a string. The changed call sites only wrap the existing loops, and they pass on the same string keys as before, so valid specifications produce the same generated code. No CLI options, public API, templates, defaults or supported Python versions change; the helpers are private and the deleted lines only show those loops being rewritten. The new test fixtures sit in the malformed test directory and are checked in the error-message tests, so this looks like clearer error reporting for invalid input, which most likely failed during processing before. I could not confirm the old behaviour from the diff alone. Overall I don't see this as a breaking change. This analysis was produced by the release draft workflow |
Fixes: #4491
Summary by CodeRabbit