Repository navigation
Description
What happened
PATCH /api/v2/admin/items/{id}/metadata doesn't validate two kinds of input the v2 contract says it should reject:
- An empty or malformed date string in
release_date(or a season or episodeair_date) returns500 internal_error. The value goes to a PostgreSQLdatecolumn as raw text, and the database rejects it. nullon a member that can't be cleared, such astitle,year, orgenres, returns 200 and changes nothing. The OpenAPI schema marks every member of this request nullable, so a client can't tell which members clear onnulland which ignore it.
Steps to reproduce
- As an admin, send
PATCH /api/v2/admin/items/{id}/metadatafor a movie with the body{"release_date":""}, then{"release_date":"not-a-date"}. Both return 500. - Send
{"title":null}. It returns 200 and the title is unchanged.
Expected behavior
A malformed or empty date is a 422 validation_failed naming the member. Per the PATCH rule in docs/architecture/api-contract.md, null on a member that can't be cleared is also a 422 validation_failed naming the member, and the schema marks only the clearable members nullable.
Silo version / commit
main at cae87c893, and the branch of #2275, which doesn't change these code paths.
Deployment
A Silo dev deployment (disposable sandbox).
Area
API
Clients affected
- Web UI
- Android
- iOS/tvOS/macOS
- Jellyfin-compat client (Infuse, Findroid, ...)
- Other/not client-specific
The web dialog sends null instead of "" for empty dates and never sends null for the other members, so it doesn't hit either case. Third-party v2 clients can.
Relevant logs
no logs availableTechnical notes
- The repositories bind
release_dateandair_datewithaddString(internal/catalog/item_repo.go,season_repo.go,episode_repo.go), and the request schema has no date format, so nothing checks the value before PostgreSQL does. - Rejecting
nullon the other members means droppingnullable:"true"from them inAdminItemMetadataUpdateand callingrejectNonNullableNullswith the clearable set, as other v2 PATCH handlers do. Narrowing a request schema is a breaking change formake verify-apiv2-contract, so it needs a breaking-change approval before 1.0 locks v2. - fix(metadata): clear a rating or date when an edit sends null #2275 makes
nullclear the ten nullable members of this request. This fix should follow it, since both change the same request type.
Validation reference
None. #1210 and #1211 cover metadata editing; neither has a passed case.
AI harness
Claude Code (running in T3 Code)
AI tool(s)
Claude Code, GitHub CLI
AI model(s)
claude-opus-5-5
AI involvement
AI-assisted
Independent or adversarial review
Found by claude-opus-5-5 and claude-sonnet-5-5 review subagents in the pre-PR review of #2275, then confirmed against the source and on a dev deployment.
Confirmations
- I searched open and recently closed issues and pull requests, and this is not already reported
- I reproduced this myself on a real deployment
- Any logs provided are raw apart from marked redactions and are not AI-summarized; if none were available, I said so above
Source: found in review of #2275
Activity
Tobechukwu-Njoku commentedon Oct 20, 2026
I'll take the first half of this: a blank or malformed
release_date,first_air_date,last_air_dateorair_datewill get422 validation_failednaming the member (dates must beYYYY-MM-DD, as the API contract says), checked in the handler before anything reaches PostgreSQL, with tests.nullstill clears these four.I'm leaving the second half (rejecting
nullon members that can't be cleared) out: droppingnullablefrom those members narrows the v2 request schema, which needs a maintainer's breaking-change approval first. I'll note that in the PR.