---
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: 7
Added: 0

--- Removed ---
FAST003 [*] Parameter `thing_id` appears in route path, but not in `single` signature
   --> FAST003.py:158:19
    |
157 | ### Errors
158 | @app.get("/things/{thing_id}")
    |                   ^^^^^^^^^^
159 | async def single(other: Annotated[str, Depends(something_else)]): ...
160 | @app.get("/things/{thing_id}")
    |
help: Add `thing_id` to function signature
    |
158 | @app.get("/things/{thing_id}")
    - async def single(other: Annotated[str, Depends(something_else)]): ...
159 + async def single(other: Annotated[str, Depends(something_else)], thing_id): ...
160 | @app.get("/things/{thing_id}")
    |
note: This is an unsafe fix and may change runtime behavior


FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_full` signature
   --> FAST003.py:197:12
    |
196 | # Errors
197 | @app.get("/{id}")
    |            ^^^^
198 | async def get_id_pydantic_full(
199 |     params: Annotated[PydanticParams, Depends(PydanticParams)],
    |
help: Add `id` to function signature
    |
198 | async def get_id_pydantic_full(
    -     params: Annotated[PydanticParams, Depends(PydanticParams)],
199 +     params: Annotated[PydanticParams, Depends(PydanticParams)], id,
200 | ): ...
    |
note: This is an unsafe fix and may change runtime behavior


FAST003 [*] Parameter `id` appears in route path, but not in `get_id_pydantic_short` signature
   --> FAST003.py:201:12
    |
199 |     params: Annotated[PydanticParams, Depends(PydanticParams)],
200 | ): ...
201 | @app.get("/{id}")
    |            ^^^^
202 | async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
203 | @app.get("/{id}")
    |
help: Add `id` to function signature
    |
201 | @app.get("/{id}")
    - async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()]): ...
202 + async def get_id_pydantic_short(params: Annotated[PydanticParams, Depends()], id): ...
203 | @app.get("/{id}")
    |
note: This is an unsafe fix and may change runtime behavior


FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing_callable_dep` signature
   --> FAST003.py:314:19
    |
314 | @app.get("/things/{thing_id}")
    |                   ^^^^^^^^^^
315 | async def read_thing_callable_dep(query: Annotated[str, Depends(CallableQuery)]): ...
    |
help: Add `thing_id` to function signature
    |
314 | @app.get("/things/{thing_id}")
    - async def read_thing_callable_dep(query: Annotated[str, Depends(CallableQuery)]): ...
315 + async def read_thing_callable_dep(query: Annotated[str, Depends(CallableQuery)], thing_id): ...
316 |
    |
note: This is an unsafe fix and may change runtime behavior


FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing_callable_dep_missing` signature
   --> FAST003.py:345:19
    |
345 | @app.get("/things/{thing_id}")
    |                   ^^^^^^^^^^
346 | async def read_thing_callable_dep_missing(query: Annotated[str, Depends(CallableQueryOther)]): ...
    |
help: Add `thing_id` to function signature
    |
345 | @app.get("/things/{thing_id}")
    - async def read_thing_callable_dep_missing(query: Annotated[str, Depends(CallableQueryOther)]): ...
346 + async def read_thing_callable_dep_missing(query: Annotated[str, Depends(CallableQueryOther)], thing_id): ...
347 |
    |
note: This is an unsafe fix and may change runtime behavior


FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing_init_and_call_instance` signature
   --> FAST003.py:351:19
    |
349 | # Error: `Depends(InitAndCallQuery())` passes an instance, so FastAPI uses
350 | # `__call__`, which has `other` — not `thing_id`.
351 | @app.get("/things/{thing_id}")
    |                   ^^^^^^^^^^
352 | async def read_thing_init_and_call_instance(query: Annotated[str, Depends(InitAndCallQuery())]): ...
    |
help: Add `thing_id` to function signature
    |
351 | @app.get("/things/{thing_id}")
    - async def read_thing_init_and_call_instance(query: Annotated[str, Depends(InitAndCallQuery())]): ...
352 + async def read_thing_init_and_call_instance(query: Annotated[str, Depends(InitAndCallQuery())], thing_id): ...
353 |
    |
note: This is an unsafe fix and may change runtime behavior


FAST003 [*] Parameter `thing_id` appears in route path, but not in `read_thing_empty_class_dep` signature
   --> FAST003.py:361:19
    |
361 | @app.get("/things/{thing_id}")
    |                   ^^^^^^^^^^
362 | async def read_thing_empty_class_dep(query: Annotated[str, Depends(EmptyClass)]): ...
    |
help: Add `thing_id` to function signature
    |
361 | @app.get("/things/{thing_id}")
    - async def read_thing_empty_class_dep(query: Annotated[str, Depends(EmptyClass)]): ...
362 + async def read_thing_empty_class_dep(query: Annotated[str, Depends(EmptyClass)], thing_id): ...
363 |
    |
note: This is an unsafe fix and may change runtime behavior
