Skip to content

fix(api): erroneous setting nesting in MetadataSettings#2964

Open
6ixfalls wants to merge 1 commit into
seerr-team:developfrom
6ixfalls:patch-1
Open

fix(api): erroneous setting nesting in MetadataSettings#2964
6ixfalls wants to merge 1 commit into
seerr-team:developfrom
6ixfalls:patch-1

Conversation

@6ixfalls
Copy link
Copy Markdown

@6ixfalls 6ixfalls commented Apr 28, 2026

Description

Fixes the api settings/metadatas route 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:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • Refactor
    • Restructured metadata settings API response format to simplify data access by removing an intermediate wrapper layer and promoting configuration properties to the top level.

@6ixfalls 6ixfalls requested a review from a team as a code owner April 28, 2026 04:34
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

The OpenAPI schema for MetadataSettings was restructured to flatten the JSON object shape. The wrapper settings property was removed, promoting the nested tv and anime fields to direct properties of MetadataSettings while preserving their types and allowed values.

Changes

Cohort / File(s) Summary
OpenAPI Schema Definition
seerr-api.yml
Flattened MetadataSettings schema by removing the settings property wrapper and promoting tv and anime fields to direct properties of the root object.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • gauthier-th
  • 0xSysR3ll

Poem

Hop hop, the schema's simplified today, 🐰
No nested wrappers in the way,
Tv and anime fields now shine,
Flat and clear, a design divine!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing incorrect nesting of settings fields in the MetadataSettings OpenAPI schema.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 205c8ec8-eebd-4324-ac07-be5ba46382f1

📥 Commits

Reviewing files that changed from the base of the PR and between d50bdad and b069732.

📒 Files selected for processing (1)
  • seerr-api.yml

Comment thread seerr-api.yml
Comment on lines 523 to +532
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'
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Suggested change
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix it @6ixfalls

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants