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.

refactor(api): add OpenAPI schema to config endpoint

Andrej Acevski8c1c3bc6c194
diff --git a/apps/api/src/config/index.ts b/apps/api/src/config/index.ts
index 09e6d4b82..6deb94b1f 100644
--- a/apps/api/src/config/index.ts
+++ b/apps/api/src/config/index.ts
@@ -1,10 +1,27 @@
import { Hono } from "hono";
+import { describeRoute, resolver } from "hono-openapi";
+import * as v from "valibot";
import getSettings from "../utils/get-settings";
-const config = new Hono().get("/", async (c) => {
- const settings = getSettings();
-
- return c.json(settings);
-});
+const config = new Hono().get(
+ "/",
+ describeRoute({
+ operationId: "getConfig",
+ tags: ["Config"],
+ description: "Get application settings and configuration",
+ responses: {
+ 200: {
+ description: "Application settings",
+ content: {
+ "application/json": { schema: resolver(v.any()) },
+ },
+ },
+ },
+ }),
+ async (c) => {
+ const settings = getSettings();
+ return c.json(settings);
+ },
+);
export default config;