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:
@@ -0,0 +1,5 @@
|
||||
import { openApiSpec } from '@/lib/openapi';
|
||||
|
||||
export async function GET() {
|
||||
return Response.json(openApiSpec);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import pkg from '@/package.json';
|
||||
|
||||
export async function GET() {
|
||||
return Response.json({ version: pkg.version });
|
||||
}
|
||||
Reference in New Issue
Block a user