-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.yaml
920 lines (920 loc) · 23.8 KB
/
schema.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
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
openapi: 3.0.0
servers:
- url: 'https://kimosabe.cyou/api/'
description: Kimosabe API
info:
description: Backend API for kimosabe.
version: 0.0.1
title: Kimosabe API
contact:
email: you@your-company.com
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
tags:
- name: Auth
- name: Comment
- name: Games
- name: Groups
- name: User
paths:
/auth/login:
post:
tags:
- Auth
summary: Login
operationId: loginUser
description: |
Logs in user, and creates a Session-Id httpOnly cookie that is used by
backend api for all queries asking for a cookie.
responses:
'200':
description: user logged in
'401':
description: username/password incorrect
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/LoginDetails'
description: user info
/auth/register:
post:
tags:
- Auth
summary: Registration
operationId: registerUser
description: |
Create a user account. Password and Username must be greater than 3
characters.
responses:
'200':
description: user created
'400':
description: 'invalid input, object invalid'
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
'409':
description: username taken
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RegistrationDetails'
description: user info
/auth/verify:
post:
tags:
- Auth
summary: Verify account
operationId: verifyUser
description: |
Verify a users account by passing in a verification token.
parameters:
- in: query
name: token
required: true
description: token string for verification
schema:
type: string
responses:
'200':
description: verification success
'/comment/{commentId}':
post:
tags:
- Comment
summary: Post comment
operationId: postComment
description: |
Post a comment in reply to a commentId, where commentId can
be a comment or a post
parameters:
- in: path
name: commentId
required: true
description: comment id
schema:
type: string
responses:
'200':
description: successfully commented
'400':
description: bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
security:
- cookie_auth: []
'/games/{gameSlug}':
get:
tags:
- Games
summary: Get game
operationId: getGameInfo
description: |
By passing in the appropriate options, you can search for
available inventory in the system
parameters:
- in: path
name: gameSlug
required: true
description: group slug
schema:
type: string
responses:
'200':
description: at most 25 paged results
'400':
description: bad input parameter
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
/games:
get:
tags:
- Games
summary: Search games
operationId: searchGames
description: |
search for available games.
Returns entries from `pageNum * pageSize ... (pageNum + 1) * pageSize`.
parameters:
- in: query
name: searchTerm
description: pass an optional search string for looking up inventory
required: true
schema:
type: string
- in: query
name: pageNum
description: 'page of search, starting at 0'
schema:
type: integer
format: int32
minimum: 0
- in: query
name: pageSize
description: 'sets how many entries per page'
schema:
type: integer
format: int32
minimum: 1
maximum: 100
default: 25
responses:
'200':
description: at most 25 paged results
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SearchResponse'
'400':
description: bad query parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
/games/searchSummary:
get:
tags:
- Games
summary: Search Summary
operationId: searchSummary
description: |
By passing in the appropriate options, this will return a summary
of the search.
parameters:
- in: query
name: searchString
description: search term to return summary for
required: true
schema:
type: string
- in: query
name: pageSize
description: |
how many results in a "page", so that number of pages
can be calculated.
required: true
schema:
type: integer
format: int32
minimum: 1
maximum: 100
default: 25
responses:
'200':
description: summary of search if it were to be performed
content:
application/json:
schema:
$ref: '#/components/schemas/SearchSummary'
'400':
description: bad query parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
'/groups/{groupSlug}':
get:
tags:
- Groups
summary: Get group
operationId: getGroup
description: |
Get group information
parameters:
- in: path
name: groupSlug
required: true
description: group slug id
schema:
type: string
responses:
'200':
description: group fetch successful
'404':
description: group or game does not exist (specified in error)
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
post:
tags:
- Groups
summary: Create group
operationId: createGroup
description: |
Create a group owned by the creator
parameters:
- in: path
name: groupSlug
required: true
description: group slug id
schema:
type: string
responses:
'200':
description: creation successful
'401':
description: user not authorized
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
'403':
description: user not verified
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
'404':
description: game slug id does not match any igdb slug
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
'409':
description: group with id already exists
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
security:
- cookie_auth: []
'/groups/{groupSlug}/join':
post:
tags:
- Groups
summary: Join group
operationId: joinGroup
description: |
Join a group
parameters:
- in: path
name: groupSlug
required: true
description: group slug
schema:
type: string
responses:
'200':
description: join successful
'404':
description: group does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
security:
- cookie_auth: []
'/groups/{groupSlug}/subgroups/{subgroupSlug}':
post:
tags:
- Groups
summary: Create subgroup
operationId: createSubgroup
description: create a new subgroup with name subgroupSlug
parameters:
- in: path
name: subgroupSlug
required: true
description: subgroup slug
schema:
type: string
- in: path
name: groupSlug
required: true
description: group slug
schema:
type: string
responses:
'200':
description: group created
'400':
description: bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SubgroupInfo'
description: Group info required for creation
security:
- cookie_auth: []
put:
tags:
- Groups
summary: Update subgroup
operationId: updateSubgroup
description: update subgroup with name subgroupSlug
parameters:
- in: path
name: subgroupSlug
required: true
description: subgroup slug
schema:
type: string
- in: path
name: groupSlug
required: true
description: group slug
schema:
type: string
responses:
'200':
description: group created
'400':
description: bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SubgroupInfo'
description: Group info required for creation
security:
- cookie_auth: []
delete:
tags:
- Groups
summary: Delete subgroup
operationId: deleteSubgroup
description: delete subgroup with name subgroupSlug
parameters:
- in: path
name: subgroupSlug
required: true
description: subgroup slug
schema:
type: string
- in: path
name: groupSlug
required: true
description: group slug
schema:
type: string
responses:
'200':
description: group created
'400':
description: bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
security:
- cookie_auth: []
get:
tags:
- Groups
summary: Get subgroup
operationId: getSubgroup
description: get subgroup with subgroupSlug
parameters:
- in: path
name: subgroupSlug
required: true
description: subgroup slug
schema:
type: string
- in: path
name: groupSlug
required: true
description: group slug
schema:
type: string
responses:
'200':
description: group info returned
'400':
description: bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
/user/changePassword:
post:
tags:
- User
summary: Change password
operationId: changePassword
description: Change password of user.
responses:
'200':
description: success
'400':
description: invalid password
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/LoginDetails'
description: Old and new password json object
security:
- cookie_auth: []
/user/friends:
post:
tags:
- User
summary: Send friend request
operationId: createfriendRequest
description: |
Send a friend request to user with username `friendUsername`.
responses:
'200':
description: request sent
'400':
description: 'invalid input, object invalid'
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateFriendRequest'
description: Inventory item to add
security:
- cookie_auth: []
put:
tags:
- User
summary: Accept/deny friend request
operationId: acceptfriendRequest
description: |
Accept or deny a friend request.
responses:
'200':
description: response successfully sent
'400':
description: 'invalid input, object invalid'
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AcceptFriendRequest'
description: Inventory item to add
security:
- cookie_auth: []
'/user/friends/{username}':
delete:
tags:
- User
summary: Delete friend
operationId: deleteFriendRelationship
description: |
Delete a friend relationship to user with username 'username'
parameters:
- in: path
name: username
schema:
type: string
required: true
description: username of friend to delete
responses:
'200':
description: friend successfully removed
security:
- cookie_auth: []
/user/profile:
put:
tags:
- User
summary: Update user info
operationId: putUserProfileInfo
description: |
update user info of logged in user
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PutUserProfileInfo'
responses:
'200':
description: update successful
'400':
description: bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
security:
- cookie_auth: []
'/user/profile/{username}':
get:
tags:
- User
summary: Get user
operationId: getUserInfo
description: |
get a users info from their username
parameters:
- in: path
name: username
schema:
type: string
required: true
description: username of user to get
responses:
'200':
description: response valid
content:
application/json:
schema:
$ref: '#/components/schemas/UserProfileInfo'
'404':
description: user not found
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
'/user/profile/{username}/friends':
get:
tags:
- User
summary: Get users friends
operationId: getUserFriends
description: |
get users friends info from their username
parameters:
- in: path
name: username
schema:
type: string
required: true
description: username of user friends to get
responses:
'200':
description: response valid
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/UserInfo'
'404':
description: user not found
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
'/user/profile/{username}/groups':
get:
tags:
- User
summary: Get user groups
operationId: getUserGroups
description: |
get a list of groups that user with `username` belongs to
parameters:
- in: path
name: username
schema:
type: string
required: true
description: username of user groups to get
responses:
'200':
description: response valid
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/GroupInfo'
'404':
description: user not found
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
'/user/block/{username}/':
post:
tags:
- User
summary: Block user
operationId: blockUser
description: |
block a user
parameters:
- in: path
name: username
schema:
type: string
required: true
description: username of user to block
responses:
'200':
description: response valid
'404':
description: user not found
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
security:
- cookie_auth: []
delete:
tags:
- User
summary: Unblock user
operationId: unblockUser
description: |
unblock a user
parameters:
- in: path
name: username
schema:
type: string
required: true
description: username of user to unblock
responses:
'200':
description: response valid
'404':
description: blocked user not found
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
security:
- cookie_auth: []
components:
schemas:
ExceptionResponse:
type: object
required:
- message
- statusCode
properties:
message:
type: string
format: string
example: this is some error message
description: message describing error
statusCode:
type: number
format: string
example: 400
description: status code of response
errors:
type: array
items:
type: string
example:
- this is one specific error
- this is another specific error
CreateFriendRequest:
type: object
required:
- friendUsername
properties:
friendUsername:
type: string
format: string
example: user1
description: username of other user
AcceptFriendRequest:
type: object
required:
- from
properties:
from:
type: string
format: string
example: user1
description: username user who send friend request
accept:
type: boolean
format: boolean
example: true
description: |
whether or not to accept friend request.
if not given, defaults to false.
LoginDetails:
type: object
required:
- username
- password
properties:
username:
type: string
format: string
example: user1
password:
type: string
example: password1
RegistrationDetails:
type: object
required:
- username
- email
- password
properties:
username:
type: string
format: string
example: user1
email:
type: string
format: string
example: user1@example.com
password:
type: string
example: password1
UserProfileInfo:
type: object
properties:
userInfo:
$ref: '#/components/schemas/UserInfo'
age:
type: number
format: number
example: 18
gender:
type: string
format: string
example: Female
location:
type: string
format: string
example: California
biography:
type: string
format: string
example: Greetings from where it never rains!
lastLogin:
type: string
format: date
example: '2020-10-26T06:21:01.933514Z'
PutUserProfileInfo:
type: object
properties:
userInfo:
$ref: '#/components/schemas/UserInfo'
age:
type: number
format: number
example: 18
gender:
type: string
format: string
example: Female
location:
type: string
format: string
example: California
biography:
type: string
format: string
example: Greetings from where it never rains!
UserInfo:
type: object
properties:
username:
type: string
format: string
example: friend_user
profileIcon:
type: string
format: string
example: 'https://path.to.file.com'
GroupInfo:
type: object
properties:
groupName:
type: string
format: string
example: baldurs gate iii
thumbUrl:
type: string
format: string
example: 'https://path.to.file.com'
SubgroupInfo:
type: object
required:
- groupName
properties:
subgroupDescription:
type: string
format: string
example: LFG for casual players
subgroupName:
type: string
format: string
example: Casual LFG
SearchSummary:
type: object
properties:
maxNumPages:
type: number
format: number
example: 200
searchTerm:
type: string
format: string
example: baldurs gate
numSearchResults:
type: number
format: number
example: 2495
SearchResponse:
type: object
properties:
name:
type: string
format: string
example: baldurs gate
coverUrl:
type: string
format: string
example: 'https://path.to.file.com'
thumbUrl:
type: string
format: string
example: 'https://path.to.file.com'
summary:
type: string
format: string
example: info about baldurs gate here
id:
type: string
format: string
example: baldurs-gate
description: game slug
securitySchemes:
cookie_auth:
type: apiKey
name: JSESSIONID
in: cookie