Skip to content
Discussion options

You must be logged in to vote

When you override dependency by function with **kwargs, FastAPI will try to resolve dependencies, find kwargs parameter and treat it as a required Query parameter.
You don't pass it, so you have error 422.

Just use lambda: Dep(1) or create new function that will declare parameters that are really needed and pass them to the __init__ of Dep

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
3 participants
Converted from issue

This discussion was converted from issue #3875 on February 28, 2023 16:38.