Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: pin the export environment instead of rewriting the servers block

Andrej Acevski0d2ac331ed2d
diff --git a/apps/api/scripts/export-openapi.ts b/apps/api/scripts/export-openapi.ts
index 00ae471ca..fe4e70ae4 100644
--- a/apps/api/scripts/export-openapi.ts
+++ b/apps/api/scripts/export-openapi.ts
@@ -2,6 +2,8 @@ import { writeFile } from "node:fs/promises";
import { resolve } from "node:path";
import { createApp } from "../src/index";
+process.env.KANEO_API_URL = "https://cloud.kaneo.app";
+
const { app } = createApp();
const response = await app.request("/api/openapi");
@@ -9,11 +11,7 @@ if (!response.ok) {
throw new Error(`OpenAPI export failed with status ${response.status}`);
}
-const spec = (await response.json()) as { servers?: unknown };
-
-spec.servers = [
- { url: "https://cloud.kaneo.app/api", description: "Kaneo API Server" },
-];
+const spec = await response.json();
const outputPath = process.argv[2]
? resolve(process.argv[2])
: resolve(import.meta.dirname, "../../docs/openapi.json");