FastAPI 0.147.0 Treats Omitted Boolean Form Fields as False

FastAPI·19 Oct 2026·2 min read

#fastapi

FastAPI 0.147.0 introduces a breaking behavioral change for boolean form fields. Omitted boolean form fields are now interpreted as False, aligning FastAPI's behavior with how HTML checkboxes work: when a checkbox is unchecked, the field is omitted from the submitted form data. Previously, omitted fields could lead to validation errors or unexpected defaults.

This change applies broadly:

  • Individual Form parameters of type boolean are affected.
  • Form models with boolean fields are also affected.
  • It applies regardless of whether the field is required or has a default value of True or None.
  • The inferred False value is considered explicitly set, so it appears in model dumps even with model_dump(exclude_unset=True).
  • JSON requests and direct Pydantic validation remain unchanged.

In other words, if a client omits a boolean field in a form submission, FastAPI will now treat it as False rather than missing. This is particularly relevant for OpenAPI schemas and generated clients where form fields may be omitted. The change is implemented in PR #16523 by @tiangolo.

The release also includes internal test additions for parameter defaults, nullability, and browser form behavior via PR #14829 by @YuriiMotov.

For developers, this is a breaking change that affects any application relying on omitted boolean form fields being treated as None or missing. If your API uses optional booleans in forms, you may need to adjust validation logic or client behavior. The new behavior simplifies form handling by matching browser semantics, but it requires careful review of existing form models and request handlers. Testing with real browser submissions and generated clients is recommended before upgrading.

Source: https://github.com/fastapi/fastapi/releases/tag/0.147.0

Related

auto-curated · source linked above← all news