forked from GEWIS/gewisdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
274 lines (268 loc) · 7.4 KB
/
openapi.yaml
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
openapi: 3.0.3
info:
title: GEWISDB API
description: |-
The GEWIS member database has a few available endpoints
termsOfService: https://gewis.nl
contact:
email: [email protected]
license:
name: GNU GENERAL PUBLIC LICENSE Version 3
url: https://github.com/GEWIS/gewisdb/blob/master/LICENSE.txt
version: b54649b155402dca833e5b1e5d9d1737f7caccd2
externalDocs:
description: Contribute to this API
url: https://github.com/GEWIS/gewisdb
servers:
- url: https://database.gewis.nl/api
description: Production environment
- url: https://database.test.gewis.nl/api
description: Test environment
tags:
- name: basic
- name: members
description: Obtain information about members
externalDocs:
description: MemberModel
url: https://gewis.github.io/gewisdb/classes/Database-Model-Member.html
paths:
/:
get:
summary: Health endpoint
description: This endpoint will return the health status of the API
tags:
- basic
responses:
200:
description: Successful
content:
application/json:
schema:
$ref: '#/components/schemas/health'
403:
$ref: '#/components/responses/no_permission'
security:
- api_auth:
- HealthR
/members:
get:
summary: Get members
description: Get all members
tags:
- members
parameters:
- name: includeOrgans
in: query
required: false
description: Whether to include organ memberships in the response. By default, organs are not included due to rather long computation time.
schema:
type: boolean
default: false
responses:
200:
description: Succesful response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Member'
403:
$ref: '#/components/responses/no_permission'
security:
- api_auth:
- MembersR
/members/{lidnr}:
get:
summary: Get a member
description: Get a specific member
tags:
- members
parameters:
- name: lidnr
in: path
required: true
schema:
type: integer
example: 8000
responses:
200:
description: Succesful response
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/MemberSimple'
204:
description: Member not found
403:
$ref: '#/components/responses/no_permission'
security:
- api_auth:
- MembersR
/members/active:
get:
summary: Get active members
description: Get all members that are currently installed in at least one organ
tags:
- members
parameters:
- name: includeInactive
in: query
required: false
description: Whether to include inactive fraternity members in the response. If a member is both an active member in another type and inactive in a fraternity, they also get returned (including possibly their inactive organ memberships).
schema:
type: boolean
default: false
responses:
200:
description: Succesful response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Member'
403:
$ref: '#/components/responses/no_permission'
security:
- api_auth:
- MembersActiveR
components:
schemas:
health:
type: object
properties:
healthy:
type: boolean
MemberSimple:
type: object
required:
- lidnr
properties:
lidnr:
type: integer
format: int32
example: 8000
minimum: 0
email:
type: string
format: email
nullable: true
example: [email protected]
fullName:
type: string
example: Timo de Teststudent
initials:
type: string
example: T.
firstName:
type: string
example: Timo
middleName:
type: string
example: de
lastName:
type: string
example: Teststudent
generation:
type: integer
example: 2022
hidden:
type: boolean
example: false
deleted:
type: boolean
example: false
expiration:
type: string
format: date
description: Date in the Y-m-d\TH:i:sP format
example: "2023-07-01T00:00:00+02:00"
MemberExtendedOrgan:
allOf:
- $ref: '#/components/schemas/MemberSimple'
- type: object
properties:
organs:
type: array
nullable: true
items:
$ref: '#/components/schemas/OrganMembership'
MemberExtendedKeyholder:
allOf:
- $ref: '#/components/schemas/MemberSimple'
- type: object
properties:
keyholder:
type: boolean
Member:
description: "If the client holds the `OrgansMembershipR` permission, a (combination of) MemberExtended object(s), else MemberSimple"
oneOf:
- $ref: '#/components/schemas/MemberExtendedOrgan'
- $ref: '#/components/schemas/MemberExtendedKeyholder'
- $ref: '#/components/schemas/MemberSimple'
OrganMembership:
type: object
properties:
organ:
$ref: '#/components/schemas/Organ'
function:
type: string
example: Lid
installDate:
type: string
format: date
description: Date in the Y-m-d\TH:i:sP format
example: "0001-01-01T00:00:00+00:00"
dischargeDate:
type: string
format: date
description: Date in the Y-m-d\TH:i:sP format
example: null
nullable: true
current:
type: boolean
Organ:
type: object
properties:
id:
type: integer
example: 1
abbreviation:
type: string
example: Testorgaan
responses:
no_permission:
description: The token that was used does not have the required permissions
content:
application/json:
schema:
type: object
properties:
status:
type: string
default: "error"
error:
type: object
properties:
type:
type: string
default: "User\\Model\\Exception\\NotAllowed"
message:
type: string
example: "Permission `...` is needed but is not currently held."
securitySchemes:
api_auth:
type: http
description: GEWIS API principal token
scheme: bearer
bearerFormat: FF