R

Ravina • 3.96K Points
Extraordinary

Q. What happens when you return a Pydantic model from a FastAPI route?

  • (A) An HTML page is rendered
  • (B) A plain string is returned
  • (C) It is automatically converted to JSON
  • (D) It is ignored
  • Correct Answer - Option(C)
  • Views: 7
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina
FastAPI automatically serializes Pydantic models to JSON in responses.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.