From fd018dc05820a4862192a07227014290b79a37f0 Mon Sep 17 00:00:00 2001 From: Thibault Le Ouay Date: Thu, 28 Nov 2024 16:43:22 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20fix=20open=20api=20docs=20(#1125?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📝 fix open api docs * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- apps/server/src/v1/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/server/src/v1/index.ts b/apps/server/src/v1/index.ts index dace222409..88cf2eb817 100644 --- a/apps/server/src/v1/index.ts +++ b/apps/server/src/v1/index.ts @@ -34,6 +34,13 @@ api.onError(handleError); api.use("/openapi", cors()); +api.openAPIRegistry.registerComponent("securitySchemes", "ApiKeyAuth", { + type: "apiKey", + in: "header", + name: "x-openstatus-key", + "x-openstatus-key": "string", +}); + api.doc("/openapi", { openapi: "3.0.0", info: { @@ -46,6 +53,11 @@ api.doc("/openapi", { description: "OpenStatus is a open-source synthetic monitoring tool that allows you to monitor your website and API's uptime, latency, and more. \n\n The OpenStatus API allows you to interact with the OpenStatus platform programmatically. \n\n To get started you need to create an account on https://www.openstatus.dev/ and create an api token in your settings.", }, + security: [ + { + ApiKeyAuth: [], + }, + ], }); api.get(