pypi fastapi 0.113.0

latest releases: 0.115.0, 0.114.2, 0.114.1...
14 days ago

Now you can declare form fields with Pydantic models:

from typing import Annotated

from fastapi import FastAPI, Form
from pydantic import BaseModel

app = FastAPI()


class FormData(BaseModel):
    username: str
    password: str


@app.post("/login/")
async def login(data: Annotated[FormData, Form()]):
    return data

Read the new docs: Form Models.

Features

  • ✨ Add support for Pydantic models in Form parameters. PR #12129 by @tiangolo.

Internal

Don't miss a new fastapi release

NewReleases is sending notifications on new releases.