Fix OpenAPI PdfOptions schema: add missing format values, waitUntil field, and template size limits
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 12m49s
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 12m49s
- Updated format enum from 6 to 11 values: added Ledger, A0, A1, A2, A6 - Added waitUntil field with enum: [load, domcontentloaded, networkidle0, networkidle2] - Added 100KB size limit documentation for headerTemplate and footerTemplate - Added comprehensive test to verify OpenAPI spec matches validation logic - All tests passing (463/463)
This commit is contained in:
parent
7d44524ae0
commit
314edc182a
2 changed files with 28 additions and 3 deletions
|
|
@ -626,6 +626,26 @@ 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", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue