fix: OpenAPI spec accuracy — hide internal endpoints, mark signup/verify deprecated
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 13m9s

- Remove @openapi annotations from /v1/billing/webhook (Stripe-internal)
- Remove @openapi annotations from /v1/billing/success (browser redirect)
- Mark /v1/signup/verify as deprecated (returns 410)
- Add 3 TDD tests in openapi-spec.test.ts
- Update 2 existing tests in app-routes.test.ts
- 530 tests passing (was 527)
This commit is contained in:
Hoid 2026-03-07 14:06:12 +01:00
parent 1d5d9adf08
commit 6b1b3d584e
15 changed files with 399 additions and 290 deletions

View file

@ -555,6 +555,21 @@ describe("OpenAPI spec", () => {
expect(paths).toContain("/v1/convert/markdown");
expect(paths).toContain("/health");
});
it("PdfOptions schema includes all valid format values and waitUntil field", async () => {
const res = await fetch(`${BASE}/openapi.json`);
const spec = await res.json();
const pdfOptions = spec.components.schemas.PdfOptions;
expect(pdfOptions).toBeDefined();
// Check that all 11 format values are included
const expectedFormats = ["Letter", "Legal", "Tabloid", "Ledger", "A0", "A1", "A2", "A3", "A4", "A5", "A6"];
expect(pdfOptions.properties.format.enum).toEqual(expectedFormats);
// Check that waitUntil field exists with correct enum values
expect(pdfOptions.properties.waitUntil).toBeDefined();
expect(pdfOptions.properties.waitUntil.enum).toEqual(["load", "domcontentloaded", "networkidle0", "networkidle2"]);
// Check that headerTemplate and footerTemplate descriptions mention 100KB limit
expect(pdfOptions.properties.headerTemplate.description).toContain("100KB");
expect(pdfOptions.properties.footerTemplate.description).toContain("100KB");
});
});
describe("404 handler", () => {
it("returns proper JSON error format for API routes", async () => {