pydantic
Technical notes on web development, DevOps, and AI integration.
3 articles
- 22:43backend
When EmailStr Rejects .test Fixtures Under Pydantic
email-validator rejects reserved test domains at the syntax layer; here is how to pick fixture domains that pass Pydantic validation.
TL;DR: CI failures on register and login endpoints came from Pydantic's EmailStr rejecting reserved domains like .test and .local at the syntax layer, before any DNS lookup. The simplest fix is swapping fixtures to example.com, example.net, or example.org, which pass validation. Alternatively, pass test_environment=True to email-validator, though Pydantic needs a custom wrapper for that.
#python#pydantic#email-validator - 00:54frontend
Chat result rows, timeline style: metadata first
The time chip and tags in the chat popup were never a CSS problem. Metadata had to travel from SQL up to the DTO before the UI could dress up.
TL;DR: The popup rows looked flat because the API never sent published_at, tags, or categories—the fix started at the database, lifting metadata through repositories, DTOs, and SSE until the frontend had data to render. The existing TimelineRow component was reused across all three popup contexts instead of copying markup. Total cost: seven files, 214 lines added.
#react#pydantic#sqlmodel - 04:46backend
Naive MariaDB DATETIME Made My API Times Wrong
Commit db470da adds _utc_aware at the repository so article timestamps from a naive MariaDB DATETIME are sent by Pydantic with a Z (UTC), not zoneless.
#mariadb#fastapi#python