This repository has been archived by the owner on May 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yml
270 lines (256 loc) · 6.79 KB
/
swagger.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
openapi: 3.0.0
info:
title: MetaGenScope Service
description: Swagger spec for documenting the MetaGenScope service
version: 0.12.0
servers:
- url: https://www.metagenscope.com/api/v1
description: Production server
- url: https://staging.metagenscope.com/api/v1
description: Staging server
security:
- bearerAuth: []
paths:
/auth/register:
post:
summary: Creates a new user
security: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
username:
type: string
email:
type: string
password:
type: string
responses:
'201':
$ref: '#/components/responses/AuthenticationResponse'
/auth/login:
post:
summary: Logs a user in
security: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
password:
type: string
responses:
'200':
$ref: '#/components/responses/AuthenticationResponse'
/auth/status:
get:
summary: Returns the logged in user's status
responses:
'200':
description: The current user
content:
application/json:
schema:
$ref: '#/components/schemas/User'
/auth/logout:
get:
summary: Logs a user out
responses:
'200':
description: Successfully logged out
content:
application/json:
schema:
type: object
/organizations:
get:
summary: Returns list of Organizations
parameters:
- $ref: '#/components/parameters/offsetParam'
- $ref: '#/components/parameters/limitParam'
responses:
'200':
description: List of Organizations
content:
application/json:
schema:
type: object
properties:
organizations:
type: array
items:
$ref: '#/components/schemas/Organization'
post:
summary: Create an Organization
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
username:
type: string
example: LongtailBio
email:
type: string
example: [email protected]
responses:
'201':
description: Newly created Organization
content:
application/json:
schema:
$ref: '#/components/schemas/Organization'
/organizations/{organization_uuid}:
get:
summary: Find Organization by UUID
parameters:
- $ref: '#/components/parameters/organizationUUID'
responses:
'200':
description: List of Organizations
content:
application/json:
schema:
$ref: '#/components/schemas/Organization'
/organizations/{organization_uuid}/users:
get:
summary: Find Users for a specific Organization
parameters:
- $ref: '#/components/parameters/organizationUUID'
- $ref: '#/components/parameters/offsetParam'
- $ref: '#/components/parameters/limitParam'
responses:
'200':
description: List of Organization's Users
content:
application/json:
schema:
type: object
properties:
users:
type: array
items:
$ref: '#/components/schemas/User'
post:
summary: Add User to an Organization
parameters:
- $ref: '#/components/parameters/organizationUUID'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
user_uuid:
type: string
format: uuid
example: '63d08ead-6f2e-4ff3-9145-ce7c0733479f'
responses:
'200':
description: Newly created Organization
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: 'bchrobot added to LongtailBio'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
User:
type: object
required:
- username
- email
properties:
uuid:
type: string
format: uuid
username:
type: string
email:
type: string
format: email
user_type:
type: string
enum: [ "user", " organization" ]
is_deleted:
type: boolean
is_fake:
type: boolean
created_at:
type: string
format: date-time
example:
uuid: '63d08ead-6f2e-4ff3-9145-ce7c0733479f'
username: bchrobot
email: [email protected]
user_type: user
is_deleted: false
is_fake: false
created_at: "2018-11-13T16:34:25.382Z"
Organization:
allOf:
- $ref: '#/components/schemas/User'
example:
uuid: '44edfe3f-6c0f-40f9-9fa6-6d3265bce43d'
username: ExampleOrganization
email: [email protected]
user_type: organization
is_deleted: false
is_fake: false
created_at: "2018-11-13T16:34:25.382Z"
parameters:
organizationUUID:
in: 'path'
name: organization_uuid
description: 'UUID of Organization that needs to be fetched'
required: true
schema:
type: string
example: '44edfe3f-6c0f-40f9-9fa6-6d3265bce43d'
offsetParam:
in: query
name: offset
required: false
schema:
type: integer
minimum: 0
description: The number of items to skip before starting to collect the result set.
limitParam:
in: query
name: limit
required: false
schema:
type: integer
minimum: 1
maximum: 50
default: 20
description: The numbers of items to return.
responses:
AuthenticationResponse:
description: JWT Response
content:
application/json:
schema:
type: object
properties:
auth_token:
type: string
format: JWT