You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently came up with the idea to remove the redundant usage of the response_model keyword in FastAPI routes. FastAPI looks at the return type annotation of the decorated function by default, so using response_model while having a return type annotation with the same value is a code duplication that should be avoided.
As someone new to Rust and contributing to Ruff, I took this opportunity to learn and implemented this rule in #11579. If you find this rule aligns with Ruff’s goals, I would kindly ask for a code review.
Thank you!
Tomer Bin
The text was updated successfully, but these errors were encountered:
As someone using FastAPI that had no idea that this is a code duplication (which exists in my project unfortunately 😅) I would love for this rule to be implemented 👍🏼
Hi there,
I recently came up with the idea to remove the redundant usage of the response_model keyword in FastAPI routes. FastAPI looks at the return type annotation of the decorated function by default, so using response_model while having a return type annotation with the same value is a code duplication that should be avoided.
As someone new to Rust and contributing to Ruff, I took this opportunity to learn and implemented this rule in #11579. If you find this rule aligns with Ruff’s goals, I would kindly ask for a code review.
Thank you!
Tomer Bin
The text was updated successfully, but these errors were encountered: