Skip to content
Brief Innovation & Growth ·

FastAPI 0.150.0 treats empty browser file inputs as missing

The release, which its notes class as a bug fix, changes how FastAPI reads forms where no file was picked.

In brief
  • FastAPI 0.150.0 counts an untouched browser file input as a missing file. Its notes class the change as a bug fix.
  • Required file fields now fail validation, and fields with defaults use them. Named zero-byte files are still accepted.

The FastAPI project released version 0.150.0 on GitHub on 19 October 2026. Its notes list one change, labelled a bug fix, from pull request #16534 by @tiangolo. If a user leaves a file box untouched, the browser still sends an entry for it, with no name and no data. FastAPI now counts that entry as a missing file.

The notes spell out four results. A required file field returns a validation error. A field with a default value or default factory uses it instead. In a list of files, boxes left untouched are skipped. A file that has a name but zero bytes is still accepted. The notes do not say how earlier versions handled an untouched box. They also do not say how many apps this touches, or whether anyone must change code.

A "required" rule depends on how a framework reads what the browser sends, so an upgrade can change what the rule means. Teams with upload forms could check their required file fields, optional fields with defaults, and list uploads. They could also search for code that expects an empty file object.

A WebPulse Brief: a short report of an important event, written by the WebPulse Newsroom with AI assistance and checked against the reporting below. When there is more to explain, we follow up with a full story. How we use AI.

Reporting: GitHub (fastapi/fastapi).