-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathopenapi3.yaml
More file actions
executable file
·602 lines (601 loc) · 24.3 KB
/
openapi3.yaml
File metadata and controls
executable file
·602 lines (601 loc) · 24.3 KB
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
openapi: 3.0.1
info:
title: Swagger definition of the tus core protocol and official extensions.
description: Swagger definition of the tus core protocol and official extensions.
The paths are not normative, but showcase the example definition at https://github.com/tus/tus-resumable-upload-protocol/blob/main/protocol.md
contact:
email: garcia@lrz.de
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: /tus/1.0.0
paths:
/files:
post:
summary: An empty POST request is used to create a new upload resource. The
Upload-Length header indicates the size of the entire upload in bytes.
If the Creation With Upload extension is available, the Client MAY include
parts of the upload in the initial Creation request
description: Endpoint for the Creation extension. Modified by the Creation With
Upload extension.
parameters:
- name: Content-Length
in: header
description: Must be 0 for creation extension. May be a positive number for
Creation With Upload extension.
schema:
type: integer
- name: Upload-Length
in: header
schema:
$ref: "#/components/schemas/Upload-Length"
- name: Tus-Resumable
in: header
schema:
$ref: "#/components/schemas/Tus-Resumable"
- name: Upload-Metadata
in: header
description: Added by the Creation extension. The Upload-Metadata request
and response header MUST consist of one or more comma-separated key-value
pairs. The key and value MUST be separated by a space. The key MUST NOT
contain spaces and commas and MUST NOT be empty. The key SHOULD be ASCII
encoded and the value MUST be Base64 encoded. All keys MUST be unique. The
value MAY be empty. In these cases, the space, which would normally separate
the key and the value, MAY be left out. Since metadata can contain arbitrary
binary values, Servers SHOULD carefully validate metadata values or sanitize
them before using them as header values to avoid header smuggling.
schema:
type: string
- name: Upload-Concat
in: header
description: Added by the Concatenation extension. The Upload-Concat request
and response header MUST be set in both partial and final upload creation
requests. It indicates whether the upload is either a partial or final upload.
If the upload is a partial one, the header value MUST be partial. In the
case of a final upload, its value MUST be final followed by a semicolon
and a space-separated list of partial upload URLs that will be concatenated.
The partial uploads URLs MAY be absolute or relative and MUST NOT contain
spaces as defined in RFC 3986.
schema:
type: string
- name: Upload-Defer-Length
in: header
description: Added by the Creation Defer Length extension. The Upload-Defer-Length
request and response header indicates that the size of the upload is not
known currently and will be transferred later. Its value MUST be 1. If the
length of an upload is not deferred, this header MUST be omitted.
schema:
type: integer
enum:
- 1
- name: Upload-Offset
in: header
schema:
$ref: "#/components/schemas/Upload-Offset"
- name: Upload-Checksum
in: header
schema:
$ref: "#/components/schemas/Upload-Checksum"
requestBody:
description: (Possibly partial) content of the file. Required if Content-Length > 0.
required: false
content:
application/offset+octet-stream:
schema:
type: string
format: binary
responses:
201:
description: Created
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Upload-Offset:
schema:
$ref: "#/components/schemas/Upload-Offset"
Upload-Expires:
description: Added by the Creation With Upload Extension in combination
with the expiration extension. The Upload-Expires response header
indicates the time after which the unfinished upload expires. A Server
MAY wish to remove incomplete uploads after a given period of time
to prevent abandoned uploads from taking up extra storage. The Client
SHOULD use this header to determine if an upload is still valid before
attempting to resume the upload. This header MUST be included in every
PATCH response if the upload is going to expire. If the expiration
is known at the creation, the Upload-Expires header MUST be included
in the response to the initial POST request. Its value MAY change
over time. If a Client does attempt to resume an upload which has
since been removed by the Server, the Server SHOULD respond with the
404 Not Found or 410 Gone status. The latter one SHOULD be used if
the Server is keeping track of expired uploads. In both cases the
Client SHOULD start a new upload. The value of the Upload-Expires
header MUST be in RFC 7231 datetime format.
schema:
type: string
Location:
description: Url of the created resource.
schema:
type: string
400:
description: Added by the Creation With Upload Extension in combination
with the checksum extension. The checksum algorithm is not supported by
the server
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
412:
description: Precondition Failed
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Tus-Version:
schema:
$ref: "#/components/schemas/Tus-Version"
413:
description: If the length of the upload exceeds the maximum, which MAY
be specified using the Tus-Max-Size header, the Server MUST respond with
the 413 Request Entity Too Large status.
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
415:
description: Added by the Creation With Upload Extension. Content-Type was
not application/offset+octet-stream
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
460:
description: Added by the Creation With Upload Extension in combination
with the checksum extension. Checksums mismatch
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
options:
summary: Request to gather information about the Server's current configuration
description: An OPTIONS request MAY be used to gather information about the
Server's current configuration. A successful response indicated by the 204
No Content or 200 OK status MUST contain the Tus-Version header. It MAY include
the Tus-Extension and Tus-Max-Size headers.
responses:
200:
description: Success
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Tus-Checksum-Algorithm:
schema:
$ref: "#/components/schemas/Tus-Checksum-Algorithm"
Tus-Version:
schema:
$ref: "#/components/schemas/Tus-Version"
Tus-Max-Size:
schema:
$ref: "#/components/schemas/Tus-Max-Size"
Tus-Extension:
schema:
$ref: "#/components/schemas/Tus-Extension"
204:
description: Success
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Tus-Checksum-Algorithm:
schema:
$ref: "#/components/schemas/Tus-Checksum-Algorithm"
Tus-Version:
schema:
$ref: "#/components/schemas/Tus-Version"
Tus-Max-Size:
schema:
$ref: "#/components/schemas/Tus-Max-Size"
Tus-Extension:
schema:
$ref: "#/components/schemas/Tus-Extension"
/files/{id}:
delete:
summary: Added by the Termination extension.
description: When receiving a DELETE request for an existing upload the Server
SHOULD free associated resources and MUST respond with the 204 No Content
status confirming that the upload was terminated. For all future requests
to this URL, the Server SHOULD respond with the 404 Not Found or 410 Gone
status.
operationId: FilesDelete
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: Tus-Resumable
in: header
required: true
schema:
$ref: "#/components/schemas/Tus-Resumable"
responses:
204:
description: Upload was terminated
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
412:
description: Precondition Failed
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Tus-Version:
schema:
$ref: "#/components/schemas/Tus-Version"
head:
summary: Used to determine the offset at which the upload should be continued.
description: Used to determine the offset at which the upload should be continued.
operationId: FilesHead
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: Tus-Resumable
in: header
required: true
schema:
$ref: "#/components/schemas/Tus-Resumable"
responses:
200:
description: Returns offset
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Cache-Control:
schema:
type: string
enum:
- no-store
Upload-Offset:
schema:
$ref: "#/components/schemas/Upload-Offset"
Upload-Length:
schema:
$ref: "#/components/schemas/Upload-Length"
403:
description: If the resource is not found, the Server SHOULD return either
the 404 Not Found, 410 Gone or 403 Forbidden status without the Upload-Offset
header.
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
404:
description: If the resource is not found, the Server SHOULD return either
the 404 Not Found, 410 Gone or 403 Forbidden status without the Upload-Offset
header.
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
410:
description: If the resource is not found, the Server SHOULD return either
the 404 Not Found, 410 Gone or 403 Forbidden status without the Upload-Offset
header.
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
412:
description: Precondition Failed
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Tus-Version:
schema:
$ref: "#/components/schemas/Tus-Version"
patch:
summary: Used to resume the upload
description: 'The Server SHOULD accept PATCH requests against any upload URL
and apply the bytes contained in the message at the given offset specified
by the Upload-Offset header. All PATCH requests MUST use Content-Type: application/offset+octet-stream,
otherwise the server SHOULD return a 415 Unsupported Media Type status.'
operationId: FilePatch
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: Tus-Resumable
in: header
required: true
schema:
$ref: "#/components/schemas/Tus-Resumable"
- name: Content-Length
in: header
description: Length of the body of this request
required: true
schema:
type: integer
- name: Upload-Offset
in: header
required: true
schema:
$ref: "#/components/schemas/Upload-Offset"
- name: Upload-Checksum
in: header
schema:
$ref: "#/components/schemas/Upload-Checksum"
requestBody:
description: Remaining (possibly partial) content of the file. Required if Content-Length > 0.
required: false
content:
application/offset+octet-stream:
schema:
type: string
format: binary
responses:
204:
description: Upload offset was updated
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Upload-Offset:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Upload-Expires:
description: Added by the expiration extension. The Upload-Expires response
header indicates the time after which the unfinished upload expires.
A Server MAY wish to remove incomplete uploads after a given period
of time to prevent abandoned uploads from taking up extra storage.
The Client SHOULD use this header to determine if an upload is still
valid before attempting to resume the upload. This header MUST be
included in every PATCH response if the upload is going to expire.
If the expiration is known at the creation, the Upload-Expires header
MUST be included in the response to the initial POST request. Its
value MAY change over time. If a Client does attempt to resume an
upload which has since been removed by the Server, the Server SHOULD
respond with the 404 Not Found or 410 Gone status. The latter one
SHOULD be used if the Server is keeping track of expired uploads.
In both cases the Client SHOULD start a new upload. The value of the
Upload-Expires header MUST be in RFC 7231 datetime format.
schema:
type: string
400:
description: Added by the checksum extension. The checksum algorithm is
not supported by the server
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
403:
description: In the concatenation extension, the Server MUST respond with
the 403 Forbidden status to PATCH requests against a final upload URL
and MUST NOT modify the final or its partial uploads.
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
404:
description: PATCH request against a non-existent resource
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
409:
description: PATCH request with Upload-Offset unequal to the offset of the resource on the server. The Upload-Offset header's value MUST be equal to the current offset of the resource.
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
410:
description: PATCH request against a non-existent resource
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
412:
description: Precondition Failed
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Tus-Version:
schema:
$ref: "#/components/schemas/Tus-Version"
415:
description: Content-Type was not application/offset+octet-stream
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
460:
description: Added by the checksum extension. Checksums mismatch
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
post:
summary: Used to resume the upload
description: 'This method is practically the same as the patch. Except that it uses the
X-HTTP-Method-Override header to simulate a PATCH'
operationId: FilePatchViaPost
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: Tus-Resumable
in: header
required: true
schema:
$ref: "#/components/schemas/Tus-Resumable"
- name: Content-Length
in: header
description: Length of the body of this request
required: true
schema:
type: integer
- name: Upload-Offset
in: header
required: true
schema:
$ref: "#/components/schemas/Upload-Offset"
- name: Upload-Checksum
in: header
schema:
$ref: "#/components/schemas/Upload-Checksum"
- name: X-HTTP-Method-Override
in: header
schema:
type: string
enum: [PATCH]
required: true
requestBody:
description: Remaining (possibly partial) content of the file. Required if Content-Length > 0.
required: false
content:
application/offset+octet-stream:
schema:
type: string
format: binary
responses:
204:
description: Upload offset was updated
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Upload-Offset:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Upload-Expires:
description: Added by the expiration extension. The Upload-Expires response
header indicates the time after which the unfinished upload expires.
A Server MAY wish to remove incomplete uploads after a given period
of time to prevent abandoned uploads from taking up extra storage.
The Client SHOULD use this header to determine if an upload is still
valid before attempting to resume the upload. This header MUST be
included in every PATCH (via POST) response if the upload is going to expire.
If the expiration is known at the creation, the Upload-Expires header
MUST be included in the response to the initial POST request. Its
value MAY change over time. If a Client does attempt to resume an
upload which has since been removed by the Server, the Server SHOULD
respond with the 404 Not Found or 410 Gone status. The latter one
SHOULD be used if the Server is keeping track of expired uploads.
In both cases the Client SHOULD start a new upload. The value of the
Upload-Expires header MUST be in RFC 7231 datetime format.
schema:
type: string
400:
description: Added by the checksum extension. The checksum algorithm is
not supported by the server
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
403:
description: In the concatenation extension, the Server MUST respond with
the 403 Forbidden status to PATCH (via POST) requests against a final upload URL
and MUST NOT modify the final or its partial uploads.
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
404:
description: PATCH (via POST) request against a non-existent resource
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
409:
description: PATCH (via POST) request with Upload-Offset unequal to the offset of the resource on the server. The Upload-Offset header's value MUST be equal to the current offset of the resource.
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
410:
description: PATCH (via POST) request against a non-existent resource
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
412:
description: Precondition Failed
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
Tus-Version:
schema:
$ref: "#/components/schemas/Tus-Version"
415:
description: Content-Type was not application/offset+octet-stream
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
460:
description: Added by the checksum extension. Checksums mismatch
headers:
Tus-Resumable:
schema:
$ref: "#/components/schemas/Tus-Resumable"
components:
schemas:
Tus-Resumable:
type: string
enum:
- 1.0.0
description: Protocol version
Tus-Version:
description: The Tus-Version response header MUST be a comma-separated
list of protocol versions supported by the Server. The list MUST be
sorted by Server's preference where the first one is the most preferred
one.
type: string
Tus-Extension:
description: The Tus-Extension response header MUST be a comma-separated
list of the extensions supported by the Server. If no extensions are
supported, the Tus-Extension header MUST be omitted.
type: string
Tus-Max-Size:
description: The Tus-Max-Size response header MUST be a non-negative
integer indicating the maximum allowed size of an entire upload in
bytes. The Server SHOULD set this header if there is a known hard
limit.
type: integer
Upload-Length:
description: The Upload-Length request and response header indicates the size
of the entire upload in bytes. The value MUST be a non-negative integer.
In the concatenation extension, the Client MUST NOT include the Upload-Length
header in the final upload creation
type: integer
Upload-Offset:
description: The Upload-Offset request and response header indicates
a byte offset within a resource. The value MUST be a non-negative
integer.
type: integer
Tus-Checksum-Algorithm:
description: Added by the checksum extension. The Tus-Checksum-Algorithm
response header MUST be a comma-separated list of the checksum algorithms
supported by the server.
type: string
Upload-Checksum:
description: Added by the checksum extension. The Upload-Checksum request
header contains information about the checksum of the current body payload.
The header MUST consist of the name of the used checksum algorithm and the
Base64 encoded checksum separated by a space.
type: string