Annotated
dependencies are interpreted incorrectly when using PEP 695
-style type alias.
#10719
Open
9 tasks done
Labels
question
Question or problem
Discussed in #10662
Originally posted by Rockmizu November 16, 2023
First Check
Commit to Help
Example Code
Description
When using the method in line 15:
to declare a type alias, FastAPI correctly interprets it and fills the
value
with123
forget_with_dep
.However, when using the new type alias syntax introduced in Python 3.12 (line 18):
FastAPI interprets it as a URL query parameter and responds with HTTP 422 Unprocessable Entity when accessing
/
.Expected Response
HTTP 200 OK
Actual Response
HTTP 422 Unprocessable Entity
Operating System
Windows
Operating System Details
No response
FastAPI Version
0.104.1
Pydantic Version
2.5.1
Python Version
Python 3.12.0
Additional Context
No response
The text was updated successfully, but these errors were encountered: