Fastapi Updates & Release Notes
- Einträge
- 82
- Quellen
- 1
- Zuletzt aktualisiert
- Kategorie
- Programmiersprachen und Bibliotheken
Folge Fastapi, um die Release Notes in deinen Feed zu holen.
0.158.0
0.158.1
0.158.2
0.159.0
Features
0.159.1
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
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
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
0.154.0
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
0.156.0
0.156.1
0.156.2
0.156.3
0.156.4
Fixes
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.
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
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.