Why do variable types get lost when using lambda expressions and dependency injection? #11766
Unanswered
mht2953658596
asked this question in
Questions
Replies: 1 comment
-
That's beause FastAPI inspects the signature of the function you wrap by |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
When one query parameter depends on another, the type of y becomes str.
But when I use a regular function instead of a lambda expression, the type does not convert to str. Why is that?
Operating System
Windows
Operating System Details
No response
FastAPI Version
0.95.2
Pydantic Version
1.10.8
Python Version
Python 3.8.16
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions