Skip to content

Commit d24982d

Browse files
InfantLabclaude
andcommitted
fix(api-docs): declare bearerAuth security scheme in OpenAPI spec
defineRouteMeta() blocks on admin handlers reference a "bearerAuth" security scheme, but nothing declared it globally — Scalar would render those endpoints as having an unknown auth method. Add the scheme to nitro.openAPI.$global.components.securitySchemes so it's recognised across the whole spec. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bd606f1 commit d24982d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

app/nuxt.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,22 @@ export default defineNuxtConfig({
175175
"REST API for Ta-Da! — authenticate with a Bearer API key (tada_key_…). Admin endpoints require the caller's user id to be in ADMIN_USER_IDS on the server.",
176176
version: pkg.version,
177177
},
178+
// Global components — declare the Bearer security scheme referenced
179+
// by defineRouteMeta() blocks on individual handlers, so Scalar
180+
// renders it as a recognised auth method rather than "Unknown".
181+
$global: {
182+
components: {
183+
securitySchemes: {
184+
bearerAuth: {
185+
type: "http",
186+
scheme: "bearer",
187+
bearerFormat: "tada_key_…",
188+
description:
189+
"API key issued via POST /api/v1/auth/keys. Send as `Authorization: Bearer tada_key_…`.",
190+
},
191+
},
192+
},
193+
},
178194
ui: {
179195
scalar: {
180196
route: "/api-docs",

0 commit comments

Comments
 (0)