R

Ravina • 3.96K Points
Extraordinary

Q. How can you enforce numeric range in FastAPI query parameters?

  • (A) range(min, max)
  • (B) Numeric(min=, max=)
  • (C) Query(..., ge=1, le=100)
  • (D) validate(min=1, max=100)
  • Correct Answer - Option(C)
  • Views: 10
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina
`Query(..., ge=1, le=100)` sets validation for greater than or equal to and less than or equal to.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.