fix(api): erroneous setting nesting in MetadataSettings#2964
Conversation
📝 WalkthroughWalkthroughThe OpenAPI schema for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@seerr-api.yml`:
- Around line 523-532: The OpenAPI schema for MetadataSettings is missing a
required list for the tv and anime properties; update the MetadataSettings
object schema to include "required": ["tv","anime"] so the tv and anime string
enums are enforced and match the runtime expectations in
server/lib/settings/index.ts (where MetadataSettings is read at lines handling
the settings route) and any validation that expects direct tv/anime fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| type: object | ||
| properties: | ||
| settings: | ||
| type: object | ||
| properties: | ||
| tv: | ||
| type: string | ||
| enum: [tvdb, tmdb] | ||
| example: 'tvdb' | ||
| anime: | ||
| type: string | ||
| enum: [tvdb, tmdb] | ||
| example: 'tvdb' | ||
| tv: | ||
| type: string | ||
| enum: [tvdb, tmdb] | ||
| example: 'tvdb' | ||
| anime: | ||
| type: string | ||
| enum: [tvdb, tmdb] | ||
| example: 'tvdb' |
There was a problem hiding this comment.
Mark tv and anime as required to match the actual API contract.
At Line 523, MetadataSettings defines properties but not required, so the schema allows empty/partial objects. That conflicts with MetadataSettings usage in server/lib/settings/index.ts:116-119 and the settings route expecting direct tv/anime fields.
📌 Proposed OpenAPI fix
MetadataSettings:
type: object
properties:
tv:
type: string
enum: [tvdb, tmdb]
example: 'tvdb'
anime:
type: string
enum: [tvdb, tmdb]
example: 'tvdb'
+ required:
+ - tv
+ - anime📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| type: object | |
| properties: | |
| settings: | |
| type: object | |
| properties: | |
| tv: | |
| type: string | |
| enum: [tvdb, tmdb] | |
| example: 'tvdb' | |
| anime: | |
| type: string | |
| enum: [tvdb, tmdb] | |
| example: 'tvdb' | |
| tv: | |
| type: string | |
| enum: [tvdb, tmdb] | |
| example: 'tvdb' | |
| anime: | |
| type: string | |
| enum: [tvdb, tmdb] | |
| example: 'tvdb' | |
| type: object | |
| properties: | |
| tv: | |
| type: string | |
| enum: [tvdb, tmdb] | |
| example: 'tvdb' | |
| anime: | |
| type: string | |
| enum: [tvdb, tmdb] | |
| example: 'tvdb' | |
| required: | |
| - tv | |
| - anime |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@seerr-api.yml` around lines 523 - 532, The OpenAPI schema for
MetadataSettings is missing a required list for the tv and anime properties;
update the MetadataSettings object schema to include "required": ["tv","anime"]
so the tv and anime string enums are enforced and match the runtime expectations
in server/lib/settings/index.ts (where MetadataSettings is read at lines
handling the settings route) and any validation that expects direct tv/anime
fields.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Description
Fixes the api
settings/metadatasroute in the OpenAPI schema. The request and response bodies were previously incorrect (nested inside settings, but this doesn't exist in the API code @ https://github.com/seerr-team/seerr/blob/develop/server/routes/settings/metadata.ts).How Has This Been Tested?
Visually verified to be correct.
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit