-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathswagger.json
323 lines (323 loc) · 11.3 KB
/
swagger.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
{
"swagger": "2.0",
"info": {
"description": "A painless HTML to PDF rendering service. Generate PDF reports and documents from HTML templates or raw HTML.",
"title": "PdfTurtle API",
"contact": {
"name": "Lucas Gaitzsch",
"email": "[email protected]"
},
"license": {
"name": "AGPL-3.0",
"url": "https://github.com/lucas-gaitzsch/pdf-turtle/blob/main/LICENSE"
},
"version": "1.1"
},
"paths": {
"/api/pdf/from/html-bundle/render": {
"post": {
"description": "Returns PDF file generated from bundle (Zip-File) of HTML or HTML template of body, header, footer and assets. The index.html file in the Zip-Bundle is required",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/pdf"
],
"tags": [
"Render HTML-Bundle"
],
"summary": "Render PDF from bundle including HTML(-Template) with model and assets provided in form-data (keys: bundle, model)",
"parameters": [
{
"type": "file",
"description": "Bundle Zip-File",
"name": "bundle",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "JSON-Model for template (only required for template)",
"name": "model",
"in": "formData"
},
{
"type": "string",
"description": "Template engine to use for template (only required for template)",
"name": "templateEngine",
"in": "formData"
}
],
"responses": {
"200": {
"description": "PDF File"
}
}
}
},
"/api/pdf/from/html-template/render": {
"post": {
"description": "Returns PDF file generated from HTML template plus model of body, header and footer",
"consumes": [
"application/json"
],
"produces": [
"application/pdf"
],
"tags": [
"Render HTML-Template"
],
"summary": "Render PDF from HTML template",
"parameters": [
{
"description": "Render Data",
"name": "renderTemplateData",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/RenderTemplateData"
}
}
],
"responses": {
"200": {
"description": "PDF File"
}
}
}
},
"/api/pdf/from/html-template/test": {
"post": {
"description": "Returns information about matching model data to template",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Render HTML-Template"
],
"summary": "Test HTML template matching model",
"parameters": [
{
"description": "Render Data",
"name": "renderTemplateData",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/RenderTemplateData"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/TemplateTestResult"
}
}
}
}
},
"/api/pdf/from/html/render": {
"post": {
"description": "Returns PDF file generated from HTML of body, header and footer",
"consumes": [
"application/json"
],
"produces": [
"application/pdf"
],
"tags": [
"Render HTML"
],
"summary": "Render PDF from HTML",
"parameters": [
{
"description": "Render Data",
"name": "renderData",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/RenderData"
}
}
],
"responses": {
"200": {
"description": "PDF File"
}
}
}
},
"/health": {
"get": {
"consumes": [
"multipart/form-data"
],
"produces": [
"text/plain"
],
"tags": [
"Internals"
],
"summary": "Liveness probe for this service",
"responses": {
"200": {
"description": ""
}
}
}
}
},
"definitions": {
"PageSize": {
"type": "object",
"properties": {
"height": {
"description": "in mm",
"type": "integer",
"example": 297
},
"width": {
"description": "in mm",
"type": "integer",
"example": 210
}
}
},
"RenderData": {
"type": "object",
"properties": {
"footerHtml": {
"description": "Optional html for footer. If empty, the footer html will be parsed from main html (\u003cPdfFooter\u003e\u003c/PdfFooter\u003e).",
"type": "string",
"default": "\u003cdiv class=\"default-footer\"\u003e\u003cdiv\u003e\u003cspan class=\"pageNumber\"\u003e\u003c/span\u003e of \u003cspan class=\"totalPages\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e"
},
"headerHtml": {
"description": "Optional html for header. If empty, the header html will be parsed from main html (\u003cPdfHeader\u003e\u003c/PdfHeader\u003e).",
"type": "string",
"example": "\u003ch1\u003eHeading\u003c/h1\u003e"
},
"html": {
"type": "string",
"example": "\u003cb\u003eHello World\u003c/b\u003e"
},
"options": {
"$ref": "#/definitions/RenderOptions"
}
}
},
"RenderOptions": {
"type": "object",
"properties": {
"excludeBuiltinStyles": {
"type": "boolean",
"default": false
},
"landscape": {
"type": "boolean",
"default": false
},
"margins": {
"description": "margins in mm; fallback to default if null",
"$ref": "#/definitions/RenderOptionsMargins"
},
"pageFormat": {
"type": "string",
"default": "A4",
"enum": [
"A0",
"A1",
"A2",
"A3",
"A4",
"A5",
"A6",
"Letter",
"Legal"
]
},
"pageSize": {
"description": "page size in mm; overrides page format",
"$ref": "#/definitions/PageSize"
}
}
},
"RenderOptionsMargins": {
"type": "object",
"properties": {
"bottom": {
"description": "margin bottom in mm",
"type": "integer",
"default": 20
},
"left": {
"description": "margin left in mm",
"type": "integer",
"default": 25
},
"right": {
"description": "margin right in mm",
"type": "integer",
"default": 25
},
"top": {
"description": "margin top in mm",
"type": "integer",
"default": 25
}
}
},
"RenderTemplateData": {
"type": "object",
"properties": {
"footerHtmlTemplate": {
"description": "Optional template for footer. If empty, the footer template will be parsed from main template (\u003cPdfFooter\u003e\u003c/PdfFooter\u003e).",
"type": "string"
},
"headerHtmlTemplate": {
"description": "Optional template for header. If empty, the header template will be parsed from main template (\u003cPdfHeader\u003e\u003c/PdfHeader\u003e).",
"type": "string"
},
"htmlTemplate": {
"type": "string"
},
"model": {
"description": "Model with your data matching to the templates",
"type": "object"
},
"options": {
"$ref": "#/definitions/RenderOptions"
},
"templateEngine": {
"type": "string",
"default": "golang",
"enum": [
"golang",
"handlebars",
"django"
]
}
}
},
"TemplateTestResult": {
"type": "object",
"properties": {
"bodyTemplateError": {
"type": "string"
},
"footerTemplateError": {
"type": "string"
},
"headerTemplateError": {
"type": "string"
},
"isValid": {
"type": "boolean"
}
}
}
}
}