> ## Documentation Index
> Fetch the complete documentation index at: https://typewall.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# FastAPI

> Validate request bodies with the optional FastAPI integration

Install `typewall[fastapi]`, then use the canonical integration path:

```python theme={null}
from fastapi import Depends, FastAPI
from typewall import w
from typewall.integrations.fastapi import request_body

app = FastAPI()
body = request_body(w.object({"name": w.str()}))

@app.post("/users", openapi_extra=body.openapi_extra)
async def create_user(user=Depends(body)):
    return user
```

> [!NOTE]
>
> Validation failures use HTTP 422 with body-relative paths and TypeWall issue codes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.