-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.yml
157 lines (157 loc) · 3.87 KB
/
schema.yml
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
info:
description: ''
title: ''
version: ''
openapi: 3.0.0
paths:
/:
get:
description: Return all the asynchronous tasks associated with a specific user.
operationId: task_list
parameters:
- $ref: '#/components/parameters/Accept-Language'
- $ref: '#/components/parameters/X-User-FirstName'
- $ref: '#/components/parameters/X-User-LastName'
- $ref: '#/components/parameters/X-User-Email'
- $ref: '#/components/parameters/X-User-GlobalID'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedTaskList'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
tags:
- task
servers:
- url: https://{environment}.osis.uclouvain.be/tasks/v1/
variables:
environment:
default: dev
enum:
- dev # Development server
- qa # Staging server
- test # Test server
- url: https://osis.uclouvain.be/api/tasks/v1/
description: 'Production server'
components:
parameters:
Accept-Language:
in: header
name: Accept-Language
description: >
The header advertises which languages the client is able to understand, and which locale variant is preferred. (By languages, we mean natural languages, such as English, and not programming languages.)
schema:
$ref: '#/components/schemas/AcceptedLanguageEnum'
required: false
X-User-FirstName:
in: header
name: X-User-FirstName
schema:
type: string
required: false
X-User-LastName:
in: header
name: X-User-LastName
schema:
type: string
required: false
X-User-Email:
in: header
name: X-User-Email
schema:
type: string
required: false
X-User-GlobalID:
in: header
name: X-User-GlobalID
schema:
type: string
required: false
responses:
BadRequest:
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
PaginatedTaskList:
type: object
properties:
count:
type: integer
example: 3
pending_count:
type: integer
example: 3
next:
type: string
nullable: true
previous:
type: string
nullable: true
results:
type: array
items:
$ref: '#/components/schemas/Task'
Task:
type: object
properties:
uuid:
type: string
format: uuid
name:
type: string
example: 'Excel generation task'
description:
type: string
example: 'Generation of the asked data in a Excel file'
state:
$ref: '#/components/schemas/TaskStateEnum'
progression:
type: integer
example: 42
created_at:
type: string
format: date
example: '13/08/2021 10:13'
started_at:
type: string
format: date
example: '13/08/2021 10:13'
completed_at:
type: string
format: date
example: '13/08/2021 10:13'
TaskStateEnum:
type: string
enum:
- 'PENDING'
- 'PROCESSING'
- 'DONE'
AcceptedLanguageEnum:
type: string
enum:
- 'en'
- 'fr-be'
Error:
type: object
properties:
code:
type: string
message:
type: string
required:
- code
- message