pypi fastapi 0.113.0

latest releases: 0.115.4, 0.115.3, 0.115.2...
2 months 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.