Passing a type as a variable for dynamically created fastapi endpoints #1939
Unanswered
Sanchoyzer
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Gist URL: https://gist.github.com/mypy-play/a0067f2bc095dbdb03fc9e1933cc5ad8
Playground URL: https://mypy-play.net/?mypy=latest&python=3.12&gist=a0067f2bc095dbdb03fc9e1933cc5ad8
I'm trying to dynamically create a fastapi endpoint. For endpoints with a body I need to pass a schema. In this solution the code works fine, but I don't know how to fix a mypy problem.
I've read that variables-vs-type-aliases link, but I'm not sure that I can use
TypeAlias
in my case, because I need to pass a type as a variableBeta Was this translation helpful? Give feedback.
All reactions