R

Ravina • 3.96K Points
Extraordinary

Q. What is the behavior of FastAPI when you define an endpoint with the same path and method?

  • (A) Overrides the previous one
  • (B) Raises a duplicate route error
  • (C) Randomly chooses one
  • (D) Both get registered
  • Correct Answer - Option(B)
  • Views: 10
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina
FastAPI raises an error if a route with the same path and method already exists.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.