---
source: crates/ruff_linter/src/rules/fastapi/mod.rs
---
--- Linter settings ---
-linter.unresolved_target_version = 3.13
+linter.unresolved_target_version = 3.14

--- Summary ---
Removed: 10
Added: 0

--- Removed ---
FAST001 [*] FastAPI route with redundant `response_model` argument
  --> FAST001.py:17:22
   |
17 | @app.post("/items/", response_model=Item)
   |                      ^^^^^^^^^^^^^^^^^^^
18 | async def create_item(item: Item) -> Item:
19 |     return item
   |
help: Remove argument
   |
16 |
   - @app.post("/items/", response_model=Item)
17 + @app.post("/items/")
18 | async def create_item(item: Item) -> Item:
   |
note: This is an unsafe fix and may change runtime behavior


FAST001 [*] FastAPI route with redundant `response_model` argument
  --> FAST001.py:22:22
   |
22 | @app.post("/items/", response_model=list[Item])
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^
23 | async def create_item(item: Item) -> list[Item]:
24 |     return item
   |
help: Remove argument
   |
21 |
   - @app.post("/items/", response_model=list[Item])
22 + @app.post("/items/")
23 | async def create_item(item: Item) -> list[Item]:
   |
note: This is an unsafe fix and may change runtime behavior


FAST001 [*] FastAPI route with redundant `response_model` argument
  --> FAST001.py:27:22
   |
27 | @app.post("/items/", response_model=List[Item])
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^
28 | async def create_item(item: Item) -> List[Item]:
29 |     return item
   |
help: Remove argument
   |
26 |
   - @app.post("/items/", response_model=List[Item])
27 + @app.post("/items/")
28 | async def create_item(item: Item) -> List[Item]:
   |
note: This is an unsafe fix and may change runtime behavior


FAST001 [*] FastAPI route with redundant `response_model` argument
  --> FAST001.py:32:22
   |
32 | @app.post("/items/", response_model=Dict[str, Item])
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33 | async def create_item(item: Item) -> Dict[str, Item]:
34 |     return item
   |
help: Remove argument
   |
31 |
   - @app.post("/items/", response_model=Dict[str, Item])
32 + @app.post("/items/")
33 | async def create_item(item: Item) -> Dict[str, Item]:
   |
note: This is an unsafe fix and may change runtime behavior


FAST001 [*] FastAPI route with redundant `response_model` argument
  --> FAST001.py:37:22
   |
37 | @app.post("/items/", response_model=str)
   |                      ^^^^^^^^^^^^^^^^^^
38 | async def create_item(item: Item) -> str:
39 |     return item
   |
help: Remove argument
   |
36 |
   - @app.post("/items/", response_model=str)
37 + @app.post("/items/")
38 | async def create_item(item: Item) -> str:
   |
note: This is an unsafe fix and may change runtime behavior


FAST001 [*] FastAPI route with redundant `response_model` argument
  --> FAST001.py:42:21
   |
42 | @app.get("/items/", response_model=Item)
   |                     ^^^^^^^^^^^^^^^^^^^
43 | async def create_item(item: Item) -> Item:
44 |     return item
   |
help: Remove argument
   |
41 |
   - @app.get("/items/", response_model=Item)
42 + @app.get("/items/")
43 | async def create_item(item: Item) -> Item:
   |
note: This is an unsafe fix and may change runtime behavior


FAST001 [*] FastAPI route with redundant `response_model` argument
  --> FAST001.py:47:21
   |
47 | @app.get("/items/", response_model=Item)
   |                     ^^^^^^^^^^^^^^^^^^^
48 | @app.post("/items/", response_model=Item)
49 | async def create_item(item: Item) -> Item:
   |
help: Remove argument
   |
46 |
   - @app.get("/items/", response_model=Item)
47 + @app.get("/items/")
48 | @app.post("/items/", response_model=Item)
   |
note: This is an unsafe fix and may change runtime behavior


FAST001 [*] FastAPI route with redundant `response_model` argument
  --> FAST001.py:48:22
   |
47 | @app.get("/items/", response_model=Item)
48 | @app.post("/items/", response_model=Item)
   |                      ^^^^^^^^^^^^^^^^^^^
49 | async def create_item(item: Item) -> Item:
50 |     return item
   |
help: Remove argument
   |
47 | @app.get("/items/", response_model=Item)
   - @app.post("/items/", response_model=Item)
48 + @app.post("/items/")
49 | async def create_item(item: Item) -> Item:
   |
note: This is an unsafe fix and may change runtime behavior


FAST001 [*] FastAPI route with redundant `response_model` argument
  --> FAST001.py:53:24
   |
53 | @router.get("/items/", response_model=Item)
   |                        ^^^^^^^^^^^^^^^^^^^
54 | async def create_item(item: Item) -> Item:
55 |     return item
   |
help: Remove argument
   |
52 |
   - @router.get("/items/", response_model=Item)
53 + @router.get("/items/")
54 | async def create_item(item: Item) -> Item:
   |
note: This is an unsafe fix and may change runtime behavior


FAST001 [*] FastAPI route with redundant `response_model` argument
   --> FAST001.py:123:23
    |
121 | def setup_app(app_arg: FastAPI, non_app: str) -> None:
122 |     # Error
123 |     @app_arg.get("/", response_model=str)
    |                       ^^^^^^^^^^^^^^^^^^
124 |     async def get_root() -> str:
125 |         return "Hello World!"
    |
help: Remove argument
    |
122 |     # Error
    -     @app_arg.get("/", response_model=str)
123 +     @app_arg.get("/")
124 |     async def get_root() -> str:
    |
note: This is an unsafe fix and may change runtime behavior
