Zum Inhalt springen

Fastapi Updates & Release Notes

Einträge
82
Quellen
1
Zuletzt aktualisiert

Folge Fastapi, um die Release Notes in deinen Feed zu holen.

Fastapi von Tiangolo

0.157.0

Features

  • ✨ Add support for combining query, header, and cookie parameter models. PR #16573 by @tiangolo.

Docs

  • 📝 Clarify boolean query parameter parsing. PR #16569 by @tiangolo.
  • 📝 Clarify nullable query parameters and path parameter defaults. PR #16568 by @tiangolo.

Internal

  • 👷 Remove translation notifications and approval labeling. PR #16570 by @tiangolo.

Originalquelle(öffnet in neuem Tab)Problem melden

Fastapi von Tiangolo

0.151.0

JSON request bodies now distinguish an explicit null from an omitted value. For individual Body parameters, null is validated as None: nullable types accept it, and non-nullable types reject it even when a default is defined. Defaults and default factories apply only when the value is omitted. This applies both to parameters inside JSON objects and to parameters representing the entire body. Clients that used null to request a default should omit the value instead.

When a JSON object is expected because of Body(embed=True) or multiple body parameters, sending null as the entire body now returns a validation error.

Breaking Changes

  • 🐛 Distinguish JSON null from omitted body values. PR #16536 by @tiangolo.

Originalquelle(öffnet in neuem Tab)Problem melden

Fastapi von Tiangolo

0.152.0

Validation errors for header parameter models now report the HTTP header name, such as int-val, instead of the Python field name, int_val. Explicit aliases, Header(convert_underscores=False), and Pydantic models with loc_by_alias=False keep their existing behavior.

Fixes

  • 🐛 Fix header model validation errors to report HTTP header names. PR #16538 by @tiangolo.

Originalquelle(öffnet in neuem Tab)Problem melden

Fastapi von Tiangolo

0.153.0

Unions of form models now apply the same browser form handling as individual models. Empty scalar fields use defaults or produce missing-field errors, empty list items are preserved, omitted boolean fields become False, and unselected files are treated as missing. JSON request bodies are unchanged.

Fixes

  • 🐛 Apply browser form handling to unions of Pydantic models. PR #16540 by @tiangolo.

Originalquelle(öffnet in neuem Tab)Problem melden

Fastapi von Tiangolo

0.155.0

The deprecated **extra keyword arguments have been removed from Path, Query, Header, Cookie, Body, Form, and File. Unknown keyword arguments now raise TypeError. For additional JSON Schema properties, replace, for example, Query(custom="value") with Query(json_schema_extra={"custom": "value"}).

Breaking Changes

  • 🔥 Remove deprecated **extra from request parameters. PR #16545 by @tiangolo.

Originalquelle(öffnet in neuem Tab)Problem melden

Fastapi von Tiangolo

0.147.0

Omitted bool and bool | None form fields are now interpreted as False, matching unchecked HTML checkboxes. This applies to individual Form parameters and form models, including required fields and fields with defaults of True or None. The inferred value is considered explicitly set, including in model_dump(exclude_unset=True).

JSON requests and direct Pydantic validation are unchanged. See Boolean Form Fields.

Breaking Changes

Internal

  • ✅ Add tests for parameter defaults, nullability, and browser form behavior. PR #14829 by @YuriiMotov.

Originalquelle(öffnet in neuem Tab)Problem melden

Fastapi von Tiangolo

0.148.0

Defaults for omitted Query, Header, Cookie, and Form parameters and model fields are no longer treated as user input. Defaults are not validated unless validate_default=True is enabled. If you rely on validators running for omitted values, enable default validation with Field(validate_default=True) for model fields or, for example, Query(validate_default=True) for individual parameters. Body(validate_default=True) is now honored too.

For parameter models, applying a default no longer marks a field as explicitly set, so model_dump(exclude_unset=True) excludes it. Default factories run once, and validation errors no longer include injected defaults in input.

Omitted boolean form fields still become False and count as explicitly set.

Breaking Changes

  • 🐛 Fix default handling for request parameters and models. PR #16527 by @tiangolo.

Originalquelle(öffnet in neuem Tab)Problem melden

Fastapi von Tiangolo

0.149.0

Browsers submit empty text inputs as empty strings (""). FastAPI now treats empty scalar form values as missing in form models, matching individual Form parameters. Required fields return a validation error. Fields with defaults or default factories use them and remain unset in model_dump(exclude_unset=True).

Empty strings inside lists are preserved. Omitted boolean form fields still become False. JSON requests and direct Pydantic validation are unchanged.

Breaking Changes

  • 🐛 Treat empty scalar values as missing in form models. PR #16529 by @tiangolo.

Originalquelle(öffnet in neuem Tab)Problem melden