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
|
|
@ -47,7 +47,7 @@ const options: swaggerJsdoc.Options = {
|
|||
properties: {
|
||||
format: {
|
||||
type: "string",
|
||||
enum: ["A4", "Letter", "Legal", "A3", "A5", "Tabloid"],
|
||||
enum: ["Letter", "Legal", "Tabloid", "Ledger", "A0", "A1", "A2", "A3", "A4", "A5", "A6"],
|
||||
default: "A4",
|
||||
description: "Page size. Ignored if width/height are set.",
|
||||
},
|
||||
|
|
@ -76,13 +76,18 @@ const options: swaggerJsdoc.Options = {
|
|||
default: "document.pdf",
|
||||
description: "Suggested filename for the PDF download",
|
||||
},
|
||||
waitUntil: {
|
||||
type: "string",
|
||||
enum: ["load", "domcontentloaded", "networkidle0", "networkidle2"],
|
||||
description: "Wait condition for page rendering before PDF generation.",
|
||||
},
|
||||
headerTemplate: {
|
||||
type: "string",
|
||||
description: "HTML template for the page header. Requires displayHeaderFooter: true. Use these CSS classes for dynamic values: date, title, url, pageNumber, totalPages. Example: '<span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span>'",
|
||||
description: "HTML template for the page header. Requires displayHeaderFooter: true. Use these CSS classes for dynamic values: date, title, url, pageNumber, totalPages. Maximum size: 100KB. Example: '<span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span>'",
|
||||
},
|
||||
footerTemplate: {
|
||||
type: "string",
|
||||
description: "HTML template for the page footer. Requires displayHeaderFooter: true. Supports the same CSS classes as headerTemplate.",
|
||||
description: "HTML template for the page footer. Requires displayHeaderFooter: true. Supports the same CSS classes as headerTemplate. Maximum size: 100KB.",
|
||||
},
|
||||
displayHeaderFooter: {
|
||||
type: "boolean",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue