api: /api/version + OpenAPI 3.x spec generated in code

lib/openapi.ts is the machine-readable spec (served at /api/openapi) per AGENTS.md;
info.version sourced from package.json. Unit tests pin the spec shape and version sync.
This commit is contained in:
2026-09-28 15:56:29 +00:00
parent e688e9a0f0
commit 323b00d692
4 changed files with 84 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import { openApiSpec } from '@/lib/openapi';
export async function GET() {
return Response.json(openApiSpec);
}
+5
View File
@@ -0,0 +1,5 @@
import pkg from '@/package.json';
export async function GET() {
return Response.json({ version: pkg.version });
}