fix(api): correct watchlist POST request schema in OpenAPI spec - #3425
fix(api): correct watchlist POST request schema in OpenAPI spec#3425Arul1998 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe OpenAPI definition adds a ChangesWatchlist API contract
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized documentation change corrects the watchlist request schema and documented success status without changing runtime behavior; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
43d5a7a to
a9e9c33
Compare
Description
The OpenAPI spec for
POST /api/v1/watchlistused theWatchlistresponse schema as its request body. That schema is missing the requiredmediaTypefield and carries response-only fields (id,type,media,createdAt,updatedAt,requestedBy), so it does not describe what the endpoint actually accepts.As reported in #3298, this causes SDK-generated clients to send requests the backend rejects with:
This change adds a dedicated
WatchlistRequestschema that mirrors thewatchlistCreatezod validator (server/interfaces/api/watchlistCreate.ts):tmdbId(number),mediaType(movie|tv)ratingKey(string),title(string)It also corrects the documented success response from
200→201, matching the handler inserver/routes/watchlist.ts, which returnsres.status(201).No runtime code is changed this is a spec/documentation correction only.
How Has This Been Tested?
watchlistCreatezod schema) and thePOST /watchlisthandler to confirm the required fields (tmdbId,mediaType) and the201response code match the real API.seerr-api.ymlstill parses as valid YAML after the change.Screenshots / Logs (if applicable)
N/A — OpenAPI spec change only.
Checklist:
pnpm buildpnpm i18n:extract(N/A — no translation strings changed)Summary by CodeRabbit
201 Createdresponse to clearly indicate successful creation.