The Wire ยท Showcase
FASTAPI TIGHTENS STATIC FILE HANDLING, PYDANTIC ADDS FRACTION SUPPORT
By RepoJournal ยท Filed ยท About FastAPI & Pydantic
FastAPI 0.138.2 shipped with stricter HTTP method validation for static file routes, while Pydantic cleared a major type system gap by adding native Fraction support.
FastAPI released 0.138.2 [2] with a critical refactor to its frontend static file handler. The `app.frontend()` method now returns 404 for any HTTP method other than GET or HEAD when no static file matches [1]. This closes a gap where POST, PUT, and DELETE requests could leak information about your static file structure. It's a quiet but important security posture improvement for any FastAPI app serving static assets.
On the Pydantic side, the team shipped support for Python's `Fraction` type in pydantic-core [3], resolving a long-standing gap in numeric type coverage. This wraps up months of discussion around non-standard numeric types and gives you first-class validation and serialization for fractional math without custom validators. If your domain model needs precise rational arithmetic, you can now declare it directly in your schema.
Pydantic also patched compatibility issues with pytest 9.1.0 [4], which introduced breaking changes to test discovery and deprecations that were silently ignored in older pytest versions. The team caught these before they became production friction. Additionally, a regression test landed for pickling behavior of generic models across modules [5], addressing issue #9390 and preventing future serialization regressions.
Minor sponsor housekeeping hit both repos overnight [6], [7], with no impact to functionality. The FastAPI team also added "agent skills" infrastructure [8] for future AI integration patterns, though details remain minimal.
Action items
- โ Upgrade to FastAPI 0.138.2 if serving static files through app.frontend() fastapi/fastapi [plan]
- โ Add Fraction fields to validation schemas if you use fractional math pydantic/pydantic [monitor]
- โ Run Pydantic test suite against pytest 9.1.0+ to catch breakage early pydantic/pydantic [plan]
References
- [1] โป๏ธ Make `app.frontend()` return 404 for methods other than `GET` or `HEAD` with no static file matches โ fastapi/fastapi
- [2] 0.138.2 โ fastapi/fastapi
- [3] Support `Fraction` type in `pydantic-core` โ pydantic/pydantic
- [4] Fix test failures with pytest >= 9.1.0 โ pydantic/pydantic
- [5] Add regression test for pickling behavior of generic models in different modules (#13367) pydantic/pydantic
- [6] ๐ง Update sponsors: remove Stainless (#15862) fastapi/fastapi
- [7] ๐ง Update sponsors: remove Stainless โ fastapi/fastapi
- [8] Add agent skills โ pydantic/pydantic
FAQ
- What changed in FastAPI & Pydantic on June 30, 2026?
- FastAPI 0.138.2 shipped with stricter HTTP method validation for static file routes, while Pydantic cleared a major type system gap by adding native Fraction support.
- What should FastAPI & Pydantic teams do about it?
- Upgrade to FastAPI 0.138.2 if serving static files through app.frontend() โข Add Fraction fields to validation schemas if you use fractional math โข Run Pydantic test suite against pytest 9.1.0+ to catch breakage early
- Which FastAPI & Pydantic repositories shipped on June 30, 2026?
- fastapi/fastapi, pydantic/pydantic