{"openapi":"3.1.0","info":{"title":"apiland PDF Generator Service","description":"A high-performance Node.js service for generating professional PDF documents from Markdown files. Supports multiple document types with preset styling.","version":"1.0.0","contact":{"name":"apiland Development Team"},"license":{"name":"ISC"}},"servers":[{"url":"http://localhost:3000","description":"Development server"},{"url":"https://api.example.com","description":"Production server"}],"tags":[{"name":"Health","description":"Service health check"},{"name":"PDF Generation","description":"Document generation endpoints"},{"name":"Documentation","description":"API documentation endpoints"}],"paths":{"/health":{"get":{"tags":["Health"],"summary":"Health check endpoint","description":"Returns the current service status and metadata","operationId":"healthCheck","responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"},"example":{"status":"ok","service":"pdf-generator","version":"1.0.0","timestamp":"2024-01-01T00:00:00.000Z"}}}}}}},"/openapi.json":{"get":{"tags":["Documentation"],"summary":"OpenAPI specification","description":"Returns the OpenAPI 3.1.0 specification for this API with runtime configuration values","operationId":"getOpenApiSpec","responses":{"200":{"description":"OpenAPI specification","content":{"application/json":{"schema":{"type":"object","description":"OpenAPI 3.1.0 specification object"}}}}}}},"/generate/contract":{"post":{"tags":["PDF Generation"],"summary":"Generate contract PDF","description":"Generates a PDF document with formal contract styling from a Markdown file. Supports both binary PDF and base64-encoded JSON responses. File size limit is configured via MAX_FILE_SIZE_MB environment variable.","operationId":"generateContract","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Markdown file (.md or .markdown extension)"}}}}}},"parameters":[{"name":"Accept","in":"header","description":"Preferred response format","required":false,"schema":{"type":"string","enum":["application/pdf","application/json"],"default":"application/pdf"}}],"responses":{"200":{"description":"PDF generated successfully","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"$ref":"#/components/schemas/PdfJsonResponse"},"example":{"pdf":"JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlL...","filename":"contract.pdf","size":12345}}}},"400":{"description":"Bad request - Invalid file or missing file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"noFile":{"value":{"error":"Bad Request","message":"No file uploaded. Please upload a markdown file.","statusCode":400}},"invalidFile":{"value":{"error":"Bad Request","message":"Invalid file type. Only .md and .markdown files are allowed.","statusCode":400}}}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Unauthorized","message":"Invalid or missing API key","statusCode":401}}}},"500":{"description":"Internal server error - PDF generation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Server Error","message":"Failed to generate PDF","statusCode":500}}}}}}},"/generate/briefing":{"post":{"tags":["PDF Generation"],"summary":"Generate briefing PDF","description":"Generates a PDF document with project briefing styling from a Markdown file. Supports both binary PDF and base64-encoded JSON responses. File size limit is configured via MAX_FILE_SIZE_MB environment variable.","operationId":"generateBriefing","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Markdown file (.md or .markdown extension)"}}}}}},"parameters":[{"name":"Accept","in":"header","description":"Preferred response format","required":false,"schema":{"type":"string","enum":["application/pdf","application/json"],"default":"application/pdf"}}],"responses":{"200":{"description":"PDF generated successfully","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"$ref":"#/components/schemas/PdfJsonResponse"},"example":{"pdf":"JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlL...","filename":"briefing.pdf","size":8765}}}},"400":{"description":"Bad request - Invalid file or missing file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"noFile":{"value":{"error":"Bad Request","message":"No file uploaded. Please upload a markdown file.","statusCode":400}},"invalidFile":{"value":{"error":"Bad Request","message":"Invalid file type. Only markdown files (.md, .markdown) are allowed.","statusCode":400}}}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingKey":{"summary":"API key not provided","value":{"error":"Unauthorized","message":"API key is required","statusCode":401}},"invalidKey":{"summary":"Invalid API key","value":{"error":"Unauthorized","message":"Invalid API key","statusCode":401}}}}}},"413":{"description":"Payload too large - File exceeds maximum size limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Payload Too Large","message":"File too large","statusCode":413}}}},"500":{"description":"Internal server error - PDF generation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Internal Server Error","message":"Failed to generate PDF","statusCode":500}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key for authentication. Must be at least 16 characters long."}},"schemas":{"HealthResponse":{"type":"object","required":["status","service","version","timestamp"],"properties":{"status":{"type":"string","description":"Service health status","example":"ok"},"service":{"type":"string","description":"Service name","example":"pdf-generator"},"version":{"type":"string","description":"Service version","example":"1.0.0"},"timestamp":{"type":"string","format":"date-time","description":"Current server timestamp","example":"2024-01-01T00:00:00.000Z"}}},"PdfJsonResponse":{"type":"object","required":["pdf","filename","size"],"properties":{"pdf":{"type":"string","description":"Base64-encoded PDF content","example":"JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlL..."},"filename":{"type":"string","description":"Generated PDF filename","example":"contract.pdf"},"size":{"type":"integer","description":"PDF file size in bytes","example":12345}}},"ErrorResponse":{"type":"object","required":["error","message","statusCode"],"properties":{"error":{"type":"string","description":"Error type","example":"Bad Request"},"message":{"type":"string","description":"Human-readable error message","example":"No file uploaded. Please upload a markdown file."},"statusCode":{"type":"integer","description":"HTTP status code","example":400}}}}}}