mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 13:30:49 -05:00
[FastAPI] Document fix safety for FAST001 (#22655)
<!-- Thank you for contributing to Ruff/ty! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? (Please prefix with `[ty]` for ty pull requests.) - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan <!-- How was it tested? -->
This commit is contained in:
@@ -58,6 +58,11 @@ use crate::{AlwaysFixableViolation, Fix};
|
||||
/// async def create_item(item: Item) -> Item:
|
||||
/// return item
|
||||
/// ```
|
||||
///
|
||||
/// ## Fix safety
|
||||
/// This fix is always unsafe, as removing the `response_model` argument can change
|
||||
/// runtime behavior and API documentation generation. Additionally, comments inside
|
||||
/// the decorator might be removed when the argument is deleted.
|
||||
#[derive(ViolationMetadata)]
|
||||
#[violation_metadata(stable_since = "0.8.0")]
|
||||
pub(crate) struct FastApiRedundantResponseModel;
|
||||
|
||||
Reference in New Issue
Block a user