· 5 years ago · Sep 24, 2020, 08:32 AM
1{
2 "openapi": "3.0.2",
3 "info": {
4 "title": "FastAPI",
5 "version": "0.1.0"
6 },
7 "paths": {
8 "/register": {
9 "post": {
10 "summary": "Create User",
11 "description": "Register a new user into the database.\n\nArgs:\n request (UserRegistrationRequest): User Registration Request\n db (Session, optional): Database Local Session\n\nRaises:\n HTTPException: 400 - if the username already exists in the database.\n\nReturns:\n str: Operation status",
12 "operationId": "create_user_register_post",
13 "requestBody": {
14 "content": {
15 "application/json": {
16 "schema": {
17 "$ref": "#/components/schemas/UserRegistrationRequest"
18 }
19 }
20 },
21 "required": true
22 },
23 "responses": {
24 "200": {
25 "description": "Successful Response",
26 "content": {
27 "application/json": {
28 "schema": {}
29 }
30 }
31 },
32 "422": {
33 "description": "Validation Error",
34 "content": {
35 "application/json": {
36 "schema": {
37 "$ref": "#/components/schemas/HTTPValidationError"
38 }
39 }
40 }
41 }
42 }
43 }
44 },
45 "/{user_id}": {
46 "delete": {
47 "summary": "Delete User",
48 "description": "Delete a user from the database\n\nArgs:\n user_id (str): User ID to be deleted \n db (Session, optional): Database Local Session\n\nRaises:\n HTTPException: 400 - if the username to be deleted does not exist\n\nReturns:\n str: Operation status",
49 "operationId": "delete_user__user_id__delete",
50 "parameters": [
51 {
52 "required": true,
53 "schema": {
54 "title": "User Id",
55 "type": "string"
56 },
57 "name": "user_id",
58 "in": "path"
59 }
60 ],
61 "responses": {
62 "200": {
63 "description": "Successful Response",
64 "content": {
65 "application/json": {
66 "schema": {}
67 }
68 }
69 },
70 "422": {
71 "description": "Validation Error",
72 "content": {
73 "application/json": {
74 "schema": {
75 "$ref": "#/components/schemas/HTTPValidationError"
76 }
77 }
78 }
79 }
80 }
81 }
82 },
83 "/{user_id}/api_key": {
84 "get": {
85 "summary": "Get Api Key",
86 "description": "Retrieve the API key assigned to a specific user\n\nArgs:\n user_id (str): user id \n\nReturns:\n str: API key",
87 "operationId": "get_api_key__user_id__api_key_get",
88 "parameters": [
89 {
90 "required": true,
91 "schema": {
92 "title": "User Id",
93 "type": "string"
94 },
95 "name": "user_id",
96 "in": "path"
97 }
98 ],
99 "responses": {
100 "200": {
101 "description": "Successful Response",
102 "content": {
103 "application/json": {
104 "schema": {}
105 }
106 }
107 },
108 "422": {
109 "description": "Validation Error",
110 "content": {
111 "application/json": {
112 "schema": {
113 "$ref": "#/components/schemas/HTTPValidationError"
114 }
115 }
116 }
117 }
118 }
119 }
120 },
121 "/{user_id}/active-subscription": {
122 "get": {
123 "summary": "Get Active Subscription",
124 "operationId": "get_active_subscription__user_id__active_subscription_get",
125 "parameters": [
126 {
127 "required": true,
128 "schema": {
129 "title": "User Id",
130 "type": "string"
131 },
132 "name": "user_id",
133 "in": "path"
134 }
135 ],
136 "responses": {
137 "200": {
138 "description": "Successful Response",
139 "content": {
140 "application/json": {
141 "schema": {}
142 }
143 }
144 },
145 "422": {
146 "description": "Validation Error",
147 "content": {
148 "application/json": {
149 "schema": {
150 "$ref": "#/components/schemas/HTTPValidationError"
151 }
152 }
153 }
154 }
155 }
156 }
157 },
158 "/billing-config": {
159 "get": {
160 "summary": "Get Config",
161 "operationId": "get_config_billing_config_get",
162 "responses": {
163 "200": {
164 "description": "Successful Response",
165 "content": {
166 "application/json": {
167 "schema": {}
168 }
169 }
170 }
171 }
172 }
173 },
174 "/login": {
175 "post": {
176 "summary": "Login",
177 "description": "Verify the login credentials against the database\n\nArgs:\n request (UserLoginRequest): User Login Request\n db (Session, optional): Database Local Session\n\nRaises:\n HTTPException: 400 - if the user does not exists\n HTTPException: 401 - user is not authorized\n\nReturns:\n UserLoginResponse: Login response data",
178 "operationId": "login_login_post",
179 "requestBody": {
180 "content": {
181 "application/json": {
182 "schema": {
183 "$ref": "#/components/schemas/UserLoginRequest"
184 }
185 }
186 },
187 "required": true
188 },
189 "responses": {
190 "200": {
191 "description": "Successful Response",
192 "content": {
193 "application/json": {
194 "schema": {}
195 }
196 }
197 },
198 "422": {
199 "description": "Validation Error",
200 "content": {
201 "application/json": {
202 "schema": {
203 "$ref": "#/components/schemas/HTTPValidationError"
204 }
205 }
206 }
207 }
208 }
209 }
210 },
211 "/update-password": {
212 "post": {
213 "summary": "Update Password",
214 "operationId": "update_password_update_password_post",
215 "requestBody": {
216 "content": {
217 "application/json": {
218 "schema": {
219 "$ref": "#/components/schemas/UpdatePasswordRequest"
220 }
221 }
222 },
223 "required": true
224 },
225 "responses": {
226 "200": {
227 "description": "Successful Response",
228 "content": {
229 "application/json": {
230 "schema": {}
231 }
232 }
233 },
234 "422": {
235 "description": "Validation Error",
236 "content": {
237 "application/json": {
238 "schema": {
239 "$ref": "#/components/schemas/HTTPValidationError"
240 }
241 }
242 }
243 }
244 }
245 }
246 },
247 "/update-details": {
248 "post": {
249 "summary": "Update Details",
250 "operationId": "update_details_update_details_post",
251 "requestBody": {
252 "content": {
253 "application/json": {
254 "schema": {
255 "$ref": "#/components/schemas/UpdateDetailsRequest"
256 }
257 }
258 },
259 "required": true
260 },
261 "responses": {
262 "200": {
263 "description": "Successful Response",
264 "content": {
265 "application/json": {
266 "schema": {}
267 }
268 }
269 },
270 "422": {
271 "description": "Validation Error",
272 "content": {
273 "application/json": {
274 "schema": {
275 "$ref": "#/components/schemas/HTTPValidationError"
276 }
277 }
278 }
279 }
280 }
281 }
282 },
283 "/details": {
284 "get": {
285 "summary": "Update Details",
286 "operationId": "update_details_details_get",
287 "responses": {
288 "200": {
289 "description": "Successful Response",
290 "content": {
291 "application/json": {
292 "schema": {}
293 }
294 }
295 }
296 }
297 }
298 },
299 "/costs": {
300 "post": {
301 "summary": "Costs Detail",
302 "operationId": "costs_detail_costs_post",
303 "requestBody": {
304 "content": {
305 "application/json": {
306 "schema": {
307 "$ref": "#/components/schemas/CostsDetailRequest"
308 }
309 }
310 },
311 "required": true
312 },
313 "responses": {
314 "200": {
315 "description": "Successful Response",
316 "content": {
317 "application/json": {
318 "schema": {}
319 }
320 }
321 },
322 "422": {
323 "description": "Validation Error",
324 "content": {
325 "application/json": {
326 "schema": {
327 "$ref": "#/components/schemas/HTTPValidationError"
328 }
329 }
330 }
331 }
332 }
333 }
334 },
335 "/history": {
336 "post": {
337 "summary": "History",
338 "operationId": "history_history_post",
339 "requestBody": {
340 "content": {
341 "application/json": {
342 "schema": {
343 "$ref": "#/components/schemas/CostsHistoryRequests"
344 }
345 }
346 },
347 "required": true
348 },
349 "responses": {
350 "200": {
351 "description": "Successful Response",
352 "content": {
353 "application/json": {
354 "schema": {}
355 }
356 }
357 },
358 "422": {
359 "description": "Validation Error",
360 "content": {
361 "application/json": {
362 "schema": {
363 "$ref": "#/components/schemas/HTTPValidationError"
364 }
365 }
366 }
367 }
368 }
369 }
370 }
371 },
372 "components": {
373 "schemas": {
374 "CardDetails": {
375 "title": "CardDetails",
376 "required": [
377 "number",
378 "exp_month",
379 "exp_year",
380 "cvc"
381 ],
382 "type": "object",
383 "properties": {
384 "number": {
385 "title": "Number",
386 "type": "string"
387 },
388 "exp_month": {
389 "title": "Exp Month",
390 "type": "integer"
391 },
392 "exp_year": {
393 "title": "Exp Year",
394 "type": "integer"
395 },
396 "cvc": {
397 "title": "Cvc",
398 "type": "string"
399 }
400 }
401 },
402 "CostsDetailRequest": {
403 "title": "CostsDetailRequest",
404 "required": [
405 "username",
406 "month_year"
407 ],
408 "type": "object",
409 "properties": {
410 "username": {
411 "title": "Username",
412 "type": "string"
413 },
414 "month_year": {
415 "title": "Month Year",
416 "type": "string"
417 }
418 }
419 },
420 "CostsHistoryRequests": {
421 "title": "CostsHistoryRequests",
422 "required": [
423 "username",
424 "months"
425 ],
426 "type": "object",
427 "properties": {
428 "username": {
429 "title": "Username",
430 "type": "string"
431 },
432 "months": {
433 "title": "Months",
434 "type": "integer"
435 }
436 }
437 },
438 "HTTPValidationError": {
439 "title": "HTTPValidationError",
440 "type": "object",
441 "properties": {
442 "detail": {
443 "title": "Detail",
444 "type": "array",
445 "items": {
446 "$ref": "#/components/schemas/ValidationError"
447 }
448 }
449 }
450 },
451 "UpdateDetailsRequest": {
452 "title": "UpdateDetailsRequest",
453 "type": "object",
454 "properties": {
455 "full_name": {
456 "title": "Full Name",
457 "type": "string"
458 },
459 "email": {
460 "title": "Email",
461 "type": "string",
462 "format": "email"
463 },
464 "avatar_path": {
465 "title": "Avatar Path",
466 "type": "string"
467 }
468 }
469 },
470 "UpdatePasswordRequest": {
471 "title": "UpdatePasswordRequest",
472 "required": [
473 "old_password_hash",
474 "new_password_hash"
475 ],
476 "type": "object",
477 "properties": {
478 "old_password_hash": {
479 "title": "Old Password Hash",
480 "type": "string"
481 },
482 "new_password_hash": {
483 "title": "New Password Hash",
484 "type": "string"
485 }
486 }
487 },
488 "UserLoginRequest": {
489 "title": "UserLoginRequest",
490 "required": [
491 "username",
492 "password_hash"
493 ],
494 "type": "object",
495 "properties": {
496 "username": {
497 "title": "Username",
498 "type": "string"
499 },
500 "password_hash": {
501 "title": "Password Hash",
502 "type": "string"
503 }
504 }
505 },
506 "UserRegistrationRequest": {
507 "title": "UserRegistrationRequest",
508 "required": [
509 "username",
510 "full_name",
511 "password_hash",
512 "email",
513 "card"
514 ],
515 "type": "object",
516 "properties": {
517 "username": {
518 "title": "Username",
519 "type": "string"
520 },
521 "full_name": {
522 "title": "Full Name",
523 "type": "string"
524 },
525 "password_hash": {
526 "title": "Password Hash",
527 "type": "string"
528 },
529 "email": {
530 "title": "Email",
531 "type": "string",
532 "format": "email"
533 },
534 "avatar_path": {
535 "title": "Avatar Path",
536 "type": "string"
537 },
538 "card": {
539 "$ref": "#/components/schemas/CardDetails"
540 }
541 }
542 },
543 "ValidationError": {
544 "title": "ValidationError",
545 "required": [
546 "loc",
547 "msg",
548 "type"
549 ],
550 "type": "object",
551 "properties": {
552 "loc": {
553 "title": "Location",
554 "type": "array",
555 "items": {
556 "type": "string"
557 }
558 },
559 "msg": {
560 "title": "Message",
561 "type": "string"
562 },
563 "type": {
564 "title": "Error Type",
565 "type": "string"
566 }
567 }
568 }
569 }
570 }
571}