-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.yml
143 lines (143 loc) · 3.6 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
info:
description: ''
title: ''
version: ''
openapi: 3.0.0
paths:
/:
post:
description: Create an asynchronous export.
operationId: export_create
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'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExportCreate'
responses:
'302':
description: Response redirect
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
tags:
- export
servers:
- url: https://{environment}.osis.uclouvain.be/exports/v1/
variables:
environment:
default: dev
enum:
- dev # Development server
- qa # Staging server
- test # Test server
- url: https://osis.uclouvain.be/api/exports/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:
AcceptedLanguageEnum:
type: string
enum:
- 'en'
- 'fr-be'
Error:
type: object
properties:
code:
type: string
message:
type: string
required:
- code
- message
ExportTypeEnum:
type: string
enum:
- 'EXCEL'
- 'PDF'
ExportCreate:
type: object
properties:
async_task_name:
type: string
example: 'Export data'
async_task_description:
type: string
example: 'Exporting data in an Excel file'
async_task_ttl:
type: integer
example: 42
next:
type: string
example: '/program_management/'
called_from_class:
type: string
example: 'program_management.views.search.EducationGroupSearch'
filters:
type: string
example: 'academic_year=41'
type:
$ref: '#/components/schemas/ExportTypeEnum'
file_name:
type: string
example: 'my_custom_file_name'
required:
- async_task_name
- async_task_description
- next
- called_from_class
- type
- file_name