Skip to content
masterclass Buddy

FastAPI · Function

Body

FastAPI uses Pydantic models to declare and validate JSON request bodies. Body can add body metadata or wrap one model under its parameter name.

Last updated

Syntax

item: Annotated[Item, Body(embed=True)]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • BaseModel
  • Field
  • Query
  • Path
  • Annotated
  • model_dump

Source: Request Body - FastAPI. Checked 2026-11-03.