From 0bfd8ee7e96f26eedc2e6e2a099333aff43a6f59 Mon Sep 17 00:00:00 2001 From: mcremer-able Date: Thu, 4 Jan 2024 09:14:33 +0000 Subject: [PATCH 1/2] add base path to openApi spec --- src/runtime/routes/openapi.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runtime/routes/openapi.ts b/src/runtime/routes/openapi.ts index 743438eae7..7c5016d2a2 100644 --- a/src/runtime/routes/openapi.ts +++ b/src/runtime/routes/openapi.ts @@ -7,9 +7,12 @@ import type { PathsObject, } from "openapi-typescript"; import { handlersMeta } from "#internal/nitro/virtual/server-handlers"; +import { useRuntimeConfig } from "#internal/nitro"; // Served as /_nitro/openapi.json export default eventHandler((event) => { + const base = useRuntimeConfig()?.app?.baseURL + return { openapi: "3.0.0", info: { @@ -18,7 +21,7 @@ export default eventHandler((event) => { }, servers: [ { - url: "http://localhost:3000", + url: `http://localhost:3000${base}`, description: "Local Development Server", variables: {}, }, From 783d28e240273f3acf680b7c9f129b479b1571d2 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 4 Jan 2024 09:52:59 +0000 Subject: [PATCH 2/2] chore: apply automated fixes --- src/runtime/routes/openapi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/routes/openapi.ts b/src/runtime/routes/openapi.ts index 7c5016d2a2..be134acec8 100644 --- a/src/runtime/routes/openapi.ts +++ b/src/runtime/routes/openapi.ts @@ -11,7 +11,7 @@ import { useRuntimeConfig } from "#internal/nitro"; // Served as /_nitro/openapi.json export default eventHandler((event) => { - const base = useRuntimeConfig()?.app?.baseURL + const base = useRuntimeConfig()?.app?.baseURL; return { openapi: "3.0.0",