Repository navigation
Description
What happened
In the published /api/v2 OpenAPI document, a nullable request field that also carries an enum gets "type": ["string", "null"] and an enum without null. In JSON Schema 2020-12, enum applies on its own, so a schema validator rejects null for these fields, but the server accepts it and documents what it does.
On main:
ProfileUpdate.max_playback_quality: described as "Playback ceiling; null removes it",enum: ["1080p", "2160p"].DownloadSubscriptionPatchBody.quality:enum: ["original", "20mbps", "10mbps", "5mbps", "2mbps", "1mbps"].
Open PR #2940 adds a third: AdminItemMetadataUpdate.status ("null leaves it unchanged"), enum: ["pending", "matched", "unmatched"].
A client that validates requests against the schema, or a generator that builds strict types from it, refuses a null the API accepts. The bundled web types aren't affected, because openapi-typescript adds | null from type.
Steps to reproduce
Not reproduced on a deployment. Checked against contracts/api/v2/openapi.json:
import json, jsonschema
s = json.load(open("contracts/api/v2/openapi.json"))["components"]["schemas"]
jsonschema.Draft202012Validator(s["ProfileUpdate"]["properties"]["max_playback_quality"]).validate(None)
# jsonschema.ValidationError: None is not one of ['1080p', '2160p']Expected behavior
The schema of a nullable enum field accepts null: null is in its enum, or the field is expressed as anyOf of the enum and {"type": "null"}.
Silo version / commit
main at 19f59ef.
Deployment
N/A (published contract artifact).
Clients affected
Third-party clients and generators that validate against or build types from /api/v2 OpenAPI. First-party clients not known to be affected.
Relevant logs
No logs available.
Technical notes
The general fix probably belongs in the v2 schema generation in internal/apiv2: when a field is nullable and has an enum, add null to the enum. Then regenerate contracts/api/v2/openapi.json and the web types. Adding null to a request enum should be a non-breaking change in the contract diff. This fix changes the same status lines as #2940, so it should follow that PR.
AI disclosure
- Harness: Claude Code (via T3 Code)
- Tools: Claude Code; Codex CLI (cross-provider review)
- Models: claude-opus-5-5; gpt-6.1-sol
- Involvement: Found and written by AI during a review; checked against the schema with a JSON Schema validator
- Independent review: gpt-6.1-sol reported it; claude-opus-5-5 confirmed it with the snippet above
Source: found in review of #2940
Activity
blurbery commentedon Nov 5, 2026
I've left
DownloadSubscriptionPatchBody.qualityout of #3534. It's the opposite case:updateDownloadSubscriptionanswers 400 for null on all six monitor fields, so the enum without null is the one part of that schema that matches the server. The actual bug is thatPatch[T]documents those fields as nullable at all. Fixing that narrows the request contract and needs a breaking-change approval, so I'd rather do it separately.fix(apiv2): list null in the enum of nullable request members (Silo-S…
fix(apiv2): stop documenting the monitor patch fields as nullable (#3535