feat(api): publish validated OpenAPI contract
CI / validate (push) Successful in 7m15s
Release / release (push) Successful in 11m32s

This commit is contained in:
dmg
2026-09-10 15:11:57 -04:00
parent c2ac2ad16b
commit 47782b3ccc
19 changed files with 2420 additions and 12 deletions
@@ -21,7 +21,13 @@ beforeEach(() => {
});
afterEach(() => { auth.session.mockReset(); vi.unstubAllEnvs(); vi.unstubAllGlobals(); });
import { GET as get } from "./route";
import { assertResponse } from "@/test/openapi-contract";
import { GET } from "./route";
async function get(request: Request) {
const response = await GET(request);
await assertResponse("/api/admin/whoami", "get", response);
return response;
}
function request(authorization?: string) {
return new Request("https://portal.example/api/admin/whoami", { headers: authorization === undefined ? {} : { authorization } });
}