1

Problem

I am unable to use Pydantic model as a query parameter and to support things like enum, it doesn't work. You can do a hacky way to use Pydantic for query parameters with Depends but it doesn't work as well as it should.

This is a very big requirement in our company and I'm guessing that a lot of other companies use the query parameters as well.

enter image description here

Looking for solution like this

enter image description here

Additional

I would like to use Pydantic models as a Query Parameter natively without the Depends does anyone have an idea how to do it?

innicoder
  • 2,612
  • 3
  • 14
  • 29
  • @Chris Yes, this does it. Ok the Option 2 looks much more pythonic. Post it and I will accept the answer. – innicoder Feb 06 '23 at 19:09

0 Answers0