To receive a JSON request body in FastAPI, you declare a function parameter typed as a Pydantic model. FastAPI reads the body, parses the JSON, validates it against the model, and passes you a typed object — automatically.
The pattern
pydantic BaseModel
():
name:
price:
description: | =
():
{: item.name, : item.price * }
