[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:
chiri
2026-01-19 19:23:51 +03:00
committed by GitHub
parent de0189618f
commit 2b9fed3bbd

View File

@@ -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;