Skip to content

[Fix] [Issue 13533]: Multiple regressions in the handling of forms & …#14244

Closed
roozbehR wants to merge 1 commit into
fastapi:masterfrom
roozbehR:bug/issue-13533
Closed

[Fix] [Issue 13533]: Multiple regressions in the handling of forms & …#14244
roozbehR wants to merge 1 commit into
fastapi:masterfrom
roozbehR:bug/issue-13533

Conversation

@roozbehR

Copy link
Copy Markdown

Fixes #13533

Summary

When form fields are empty strings (""), FastAPI currently passes them
as "" instead of converting to None. This PR restores the previous
behavior for both application/x-www-form-urlencoded and multipart/form-data.

Changes

  • Updated _extract_form_body to normalize empty strings to None
  • Added regression tests for optional form and file fields

Tests

All tests pass locally (pytest -v).

@YuriiMotov

Copy link
Copy Markdown
Member

@roozbehR, thank you for your interest and efforts!

We already have #13537 that solves this issue in a bit more clear way.

I'll close this. Thanks again!

@YuriiMotov YuriiMotov closed this Nov 2, 2025
@roozbehR

roozbehR commented Nov 4, 2025

Copy link
Copy Markdown
Author

No worries @YuriiMotov, thank you for letting me know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple regressions in the handling of forms & form validation

2 participants