R

Ravina • 3.96K Points
Extraordinary

Q. How do you define a regex validation for a path parameter?

  • (A) Using Path(..., pattern='...')
  • (B) Using Path(..., regex='...')
  • (C) Using RegexPath('...')
  • (D) Using pattern parameter in decorator
  • Correct Answer - Option(B)
  • Views: 14
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina
`regex` argument in `Path()` allows regex validation of path parameters.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.