fix: auto response suffix - #73
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts the TypeNameCollision remedy guidance for response-enum name clashes so the error message prioritizes the per-schema x-rust-name fix before the broader response-type-suffix option, and adds a regression assertion to keep that ordering stable.
Changes:
- Reworded the response-enum collision hint to lead with
x-rust-nameand clarifyresponse-type-suffixis a global rename. - Added a coverage test assertion to verify the hint mentions
x-rust-namebeforeresponse-type-suffix. - Updated inline documentation/comments to reflect the intended guidance ordering.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oapi-codegen/tests/coverage.rs | Adds an assertion ensuring the collision hint ordering prefers x-rust-name over response-type-suffix. |
| crates/oapi-codegen/src/lower/rename.rs | Reorders and clarifies the hint text for response-enum name collisions to recommend x-rust-name first. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
crates/oapi-codegen/src/lower/rename.rs:255
- The intra-doc link
[Error::TypeNameCollision]likely doesn’t resolve in this module becauseErrorisn’t in scope here (you importcrate::error::Result, andErroris re-exported at the crate root). Using an explicit path avoids rustdoc broken-link warnings.
/// Return a [`Error::TypeNameCollision`] when `name` is already taken by an
/// emitted component model. `is_response` selects the remedy hint: for a
/// response-enum clash it leads with the surgical, per-schema `x-rust-name` fix
/// and offers the broad `response-type-suffix` as an alternative, since that
/// suffix renames *every* response enum, not just the colliding one.
|
🎉 This PR is included in version 1.0.0-dev.15 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.