Skip to content

OpenAPI schema for addKey/editKey missing several supported fields #934

@sususu98

Description

@sususu98

Problem

The OpenAPI schema definitions for addKey and editKey in src/app/api/actions/[...route]/route.ts are missing several fields that the backend Server Actions actually support. This causes these parameters to not appear in the Scalar/Swagger API documentation, even though passing them via the API works correctly.

Missing Fields

editKey (line 291-301)

Missing from requestSchema:

  • providerGroup (string | null, optional) - Provider group assignment (admin-only)
  • isEnabled (boolean, optional) - Enable/disable key
  • dailyResetMode ("fixed" | "rolling", optional) - Daily limit reset mode
  • dailyResetTime (string, optional) - Daily reset time (HH:mm format, fixed mode only)
  • cacheTtlPreference ("inherit" | "5m" | "1h", optional) - Cache TTL preference

addKey (line 263-274)

Missing from requestSchema:

  • providerGroup (string | null, optional) - Provider group assignment
  • isEnabled (boolean, optional) - Whether the key is enabled on creation
  • dailyResetMode ("fixed" | "rolling", optional) - Daily limit reset mode
  • dailyResetTime (string, optional) - Daily reset time (HH:mm format)
  • cacheTtlPreference ("inherit" | "5m" | "1h", optional) - Cache TTL preference

Impact

  • API consumers relying on Scalar/Swagger docs cannot discover these fields
  • providerGroup is particularly important as it controls provider routing for keys, and users may think it can only be set at the user level

Expected Behavior

The OpenAPI requestSchema should include all fields that the corresponding Server Action accepts, so that Scalar/Swagger documentation accurately reflects the full API surface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinggood first issueGood for newcomersstaleIssue has had no activity for 30+ days

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions