-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
I don't have a failing test for this yet but I'll try to put one together after lunch.
from typing import Annotated
from fastapi import Header
@app.get("/request")
@any_decorator
def request_method(
requestor_id: Annotated[str, Header(alias="requestor_id")],
) -> bool:
return TrueChecking the signatures we get:
(Pdb) new_signature
<Signature (requestor_id: str) -> bool>
(Pdb) original_signature
<Signature (requestor_id: Annotated[str, Header(PydanticUndefined)]) -> bool>
This results in a 422 being thrown as FastAPI turns the string into a query string paramater requirement:
{'detail': [{'input': None, 'loc': ['query', 'requestor_id'], 'msg': 'Field required', 'type': 'missing'}]}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels