From 5013ea2ef5d62b3e7a9856e74803cc1c88556446 Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Sun, 17 Apr 2022 16:18:42 +0200 Subject: [PATCH] feat: adds apiKey auth as query params in docs and users endpoint --- pages/api/docs.ts | 7 +++++-- pages/api/users/index.ts | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pages/api/docs.ts b/pages/api/docs.ts index d9aa75d18c..bb63cb79a3 100644 --- a/pages/api/docs.ts +++ b/pages/api/docs.ts @@ -9,8 +9,11 @@ const swaggerHandler = withSwagger({ title: `${pjson.name}: ${pjson.description}`, version: pjson.version, }, - components: { schemas: { ...jsonSchema.definitions } }, - definitions: jsonSchema.definitions, + components: { + securitySchemes: { ApiKeyAuth: { type: "apiKey", in: "query", name: "apiKey" } }, + schemas: { ...jsonSchema.definitions }, + }, + // definitions: jsonSchema.definitions, }, apiFolder: "pages/api", tags: ["users", "teams", "memeberships"], diff --git a/pages/api/users/index.ts b/pages/api/users/index.ts index 138395adba..84c2e7ec57 100644 --- a/pages/api/users/index.ts +++ b/pages/api/users/index.ts @@ -12,6 +12,8 @@ import { schemaUserPublic } from "@lib/validations/user"; * /v1/users: * get: * summary: Get all users (admin only), returns your user if regular user. + * security: + * - ApiKeyAuth: [] * tags: * - users * responses: