feat(openapi): add optional description field to workspace API key schemas (#13993)

* feat(openapi): add optional description field to workspace API key schemas

Add an optional `description` property (type: string) to three
workspace API key schemas in openapi.yaml:

- Inline request body of createWorkspaceApiKey (POST /api/workspace/api-keys)
- WorkspaceApiKey (list/info schema)
- WorkspaceApiKeyCreated (creation response schema)

The field is not added to any `required` array, making it fully
backward-compatible with existing clients.

Refs: BE-1005, BE-1004

Co-authored-by: Matt Miller <mattmillerai@users.noreply.github.com>

* fix(openapi): mark description nullable in workspace API key response schemas

Per CodeRabbit review on PR #13993: the underlying DB column is nullable
varchar (default ''), so the response schemas should permit null to match
stored data reality. Without nullable: true the OpenAPI contract would
require coercion on the handler side or risk a contract violation.

Request schema unchanged — clients shouldn't be sending null on create.
This commit is contained in:
Matt Miller 2026-05-19 14:48:47 -07:00 committed by GitHub
parent 626b082838
commit cc4d711eb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -4160,6 +4160,9 @@ paths:
name:
type: string
description: Display name for the API key
description:
type: string
description: User-provided description for the key
responses:
"201":
description: API key created
@ -7682,6 +7685,10 @@ components:
type: string
name:
type: string
description:
type: string
nullable: true
description: User-provided description
prefix:
type: string
description: First few characters of the key for identification
@ -7708,6 +7715,10 @@ components:
type: string
name:
type: string
description:
type: string
nullable: true
description: User-provided description
key:
type: string
description: Full API key value (only returned on creation)