-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
301 lines (301 loc) · 7.07 KB
/
openapi.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
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
openapi: 3.1.0
info:
title: 'My Fancy API'
description: 'Developer API'
contact:
name: 'API Support'
url: 'https://laravel-kickstart.test'
email: [email protected]
version: 1.2.3
servers:
-
url: 'https://laravel-kickstart.test'
description: 'My API environment'
paths:
/api/v1/info:
get:
tags:
- Info
operationId: 'GET::api.v1.info'
responses:
'200':
description: 'This endpoint returns information about the project, members and pending invitations.'
content:
application/json:
schema:
properties:
data: { $ref: '#/components/schemas/Project' }
type: object
additionalProperties: false
'403':
description: 'Not authorized'
security:
-
BearerAuth:
- info
/api/v1/members:
get:
tags:
- Members
description: 'Get all members of the project.'
operationId: 'GET::api.v1.members'
parameters:
-
name: filter
in: query
description: 'Filter members by name or email.'
required: false
style: deepObject
schema:
properties:
uuid:
type: string
example: 123e4567-e89b-12d3-a456-426614174000
name:
type: string
example: 'John Doe'
email:
type: string
example: [email protected]
type: object
-
$ref: '#/components/parameters/Page'
-
$ref: '#/components/parameters/PerPage'
responses:
'200':
description: 'Paginated list of members'
content:
application/json:
schema:
properties:
data: { type: array, items: { $ref: '#/components/schemas/Member' } }
meta: { $ref: '#/components/schemas/Pagination' }
type: object
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
security:
-
BearerAuth:
- members.list
post:
tags:
- Members
description: 'Invite a new member to the project.'
operationId: 'POST::api.v1.members'
requestBody:
required: true
content:
application/json:
schema:
properties:
email:
type: string
example: [email protected]
role_uuid:
type: string
example: 2e4567-e89b-12d3-a456-426614174000
type: object
responses:
'201':
description: 'No content'
'422':
$ref: '#/components/responses/422'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
security:
-
BearerAuth:
- members.invite
'/api/v1/members/{uuid}':
delete:
tags:
- Members
description: 'Remove member from project.'
operationId: 'DELETE::api.v1.members.{uuid}'
parameters:
-
name: uuid
in: path
description: 'The member resource identifier.'
required: true
schema:
type: string
example: 123e4567-e89b-12d3-a456-426614174000
responses:
'200':
description: 'No content'
'422':
$ref: '#/components/responses/422'
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
security:
-
BearerAuth:
- members.remove
components:
schemas:
Pagination:
properties:
current_page:
type: integer
from:
type: integer
path:
type: string
per_page:
type: integer
last_page:
type: integer
to:
type: integer
total:
type: integer
links:
type: array
items:
type: object
type: object
additionalProperties: false
Invitation:
properties:
uuid:
type: string
email:
type: string
role:
$ref: '#/components/schemas/Role'
created_at:
type: string
format: date-time
type: object
additionalProperties: false
Member:
properties:
uuid:
type: string
email:
type: string
name:
type: string
last_login_at:
type:
- string
- 'null'
format: date-time
role:
$ref: '#/components/schemas/Role'
type: object
additionalProperties: false
Project:
required:
- uuid
- name
properties:
uuid:
type: string
name:
type: string
members:
type: array
items:
$ref: '#/components/schemas/Member'
tokens:
type: array
items:
$ref: '#/components/schemas/Token'
invitations:
type: array
items:
$ref: '#/components/schemas/Token'
type: object
additionalProperties: false
Role:
properties:
uuid:
type: string
name:
type: string
permissions:
type: array
items:
type: string
example: project.delete
type: object
additionalProperties: false
Token:
properties:
id:
type: integer
name:
type: string
abilities:
type: array
items:
type: string
example: info
last_used_at:
type:
- string
- 'null'
format: date-time
type: object
additionalProperties: false
responses:
'401':
description: Unauthorized
'403':
description: Unauthorized
'422':
description: 'Failed validation'
content:
application/json:
schema:
properties:
message:
type: string
example: 'The email is required (and 1 more error)'
errors:
type: object
example:
email: ['The email is required']
role_uuid: ['The role is required']
type: object
parameters:
Page:
name: page
in: query
description: 'Page number.'
required: false
schema:
type: integer
example: 1
PerPage:
name: per_page
in: query
description: 'Page size.'
required: false
schema:
type: integer
example: 30
securitySchemes:
BearerAuth:
type: http
in: header
scheme: bearer
security:
-
BearerAuth: []
tags:
-
name: Info
description: Info
-
name: Members
description: Members