-
Notifications
You must be signed in to change notification settings - Fork 0
/
traPortfolio.v1.yaml
1596 lines (1596 loc) · 43.1 KB
/
traPortfolio.v1.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
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: traPortfolio
version: "1.0"
contact:
name: traP
url: "https://github.com/traPtitech/traPortfolio"
description: traPortfolio v1 API
servers:
- url: "https://portfolio-dev.trapti.tech/api/v1"
description: staging
- url: "http://localhost:1323/api/v1"
description: local
paths:
/users:
get:
summary: ユーザーのリストを取得
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/User"
operationId: getUsers
description: |-
ユーザー情報を取得します
`includeSuspended`を指定しない場合、レスポンスに非アクティブユーザーは含まれません。
parameters:
- $ref: "#/components/parameters/includeSuspendedInQuery"
- $ref: "#/components/parameters/nameInQuery"
- $ref: "#/components/parameters/limitInQuery"
tags:
- user
"/users/sync":
post:
summary: ユーザー情報の同期
operationId: syncUsers
responses:
"204":
description: No Content
"400":
description: Bad Request
description: ユーザー情報を同期します
tags:
- user
"/users/{userId}":
parameters:
- $ref: "#/components/parameters/userIdInPath"
get:
summary: ユーザー詳細情報の取得
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/UserDetail"
"404":
description: Not Found
operationId: getUser
description: ユーザー詳細情報を取得します
tags:
- user
patch:
summary: ユーザー情報の編集
operationId: editUser
responses:
"204":
description: No Content
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
description: ユーザー情報を修正します
tags:
- user
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EditUserRequest"
"/users/{userId}/accounts":
parameters:
- $ref: "#/components/parameters/userIdInPath"
post:
summary: アカウント情報の追加
operationId: addUserAccount
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: "#/components/schemas/Account"
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
description: アカウント情報を追加します
tags:
- user
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AddAccountRequest"
get:
summary: ユーザーアカウントのリストを取得
operationId: getUserAccounts
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Account"
"403":
description: Forbidden
"404":
description: Not Found
description: ユーザーアカウントのリストを取得します
tags:
- user
"/users/{userId}/projects":
parameters:
- $ref: "#/components/parameters/userIdInPath"
get:
summary: ユーザーが所属するプロジェクトの取得
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/UserProject"
"404":
description: Not Found
operationId: getUserProjects
description: ユーザーが所属している(いた)プロジェクトを取得します
tags:
- user
- project
"/users/{userId}/contests":
parameters:
- $ref: "#/components/parameters/userIdInPath"
get:
summary: ユーザーが参加したコンテストの取得
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/UserContest"
"404":
description: Not Found
operationId: getUserContests
description: ユーザーが参加したコンテストを取得します
tags:
- user
- contest
"/users/{userId}/groups":
parameters:
- $ref: "#/components/parameters/userIdInPath"
get:
summary: ユーザーが所属した班の取得
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/UserGroup"
"404":
description: Not Found
operationId: getUserGroups
description: ユーザーが所属しているまたは所属したことのある班を取得します
tags:
- user
- group
"/users/{userId}/events":
parameters:
- $ref: "#/components/parameters/userIdInPath"
get:
summary: ユーザーが開催したイベントの取得
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Event"
"404":
description: Not Found
operationId: getUserEvents
description: ユーザーが開催したイベントを取得します
tags:
- user
- event
"/users/me":
get:
summary: 自分のユーザー情報の取得
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/UserDetail"
"404":
description: Not Found
operationId: getMe
description: 自分のユーザー情報を取得します
tags:
- user
/projects:
get:
summary: プロジェクトのリストを取得
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Project"
operationId: getProjects
description: プロジェクトのリストを取得します
tags:
- project
post:
summary: プロジェクトの作成
operationId: createProject
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectDetail"
"400":
description: Bad Request
description: プロジェクトを作成します
tags:
- project
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateProjectRequest"
"/projects/{projectId}":
parameters:
- $ref: "#/components/parameters/projectIdInPath"
get:
summary: プロジェクト詳細情報を取得
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectDetail"
"404":
description: Not Found
operationId: getProject
description: プロジェクトの詳細情報を取得します
tags:
- project
patch:
summary: プロジェクト詳細情報の修正
operationId: editProject
responses:
"204":
description: No Content
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
description: プロジェクト情報を修正します
tags:
- project
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/EditProjectRequest"
delete:
summary: プロジェクトの削除
operationId: deleteProject
responses:
"204":
description: No Content
"403":
description: Forbidden
"404":
description: Not Found
description: プロジェクトを削除します
tags:
- project
/events:
get:
summary: イベントリストを取得
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Event"
operationId: getEvents
description: イベント情報を取得します
tags:
- event
parameters: []
"/events/{eventId}":
parameters:
- $ref: "#/components/parameters/eventIdInPath"
get:
summary: イベント詳細情報を取得
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/EventDetail"
"404":
description: Not Found
operationId: getEvent
description: イベント情報詳細を取得します
tags:
- event
patch:
summary: ""
operationId: editEvent
responses:
"204":
description: No Content
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
description: イベント情報を修正します
tags:
- event
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EditEventRequest"
/groups:
get:
summary: 班のリストの取得
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Group"
operationId: getGroups
description: 班のリストを取得します
tags:
- group
parameters: []
"/groups/{groupId}":
parameters:
- $ref: "#/components/parameters/groupIdInPath"
get:
summary: 班の情報の取得
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/GroupDetail"
operationId: getGroup
description: 班の情報を取得します
tags:
- group
/contests:
get:
summary: コンテストのリストの取得
tags:
- contest
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Contest"
operationId: getContests
description: コンテストのリストを取得します
parameters: []
post:
summary: コンテストの作成
operationId: createContest
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: "#/components/schemas/ContestDetail"
"400":
description: Bad Request
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateContestRequest"
tags:
- contest
description: コンテストを作成します
"/contests/{contestId}":
parameters:
- $ref: "#/components/parameters/contestIdInPath"
get:
summary: コンテスト詳細情報の取得
tags:
- contest
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ContestDetail"
"404":
description: Not Found
operationId: getContest
description: コンテスト詳細情報を取得します
patch:
summary: コンテスト情報の修正
operationId: editContest
responses:
"204":
description: No Content
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
description: コンテスト情報を修正します
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/EditContestRequest"
tags:
- contest
delete:
summary: コンテストの削除
operationId: deleteContest
responses:
"204":
description: No Content
"403":
description: Forbidden
"404":
description: Not Found
description: コンテストを削除します
tags:
- contest
"/contests/{contestId}/teams":
parameters:
- $ref: "#/components/parameters/contestIdInPath"
get:
summary: コンテストチームのリストの取得
tags:
- contest
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ContestTeam"
"404":
description: Not Found
operationId: getContestTeams
description: コンテストのチーム情報を取得します
post:
summary: コンテストチームの追加
operationId: addContestTeam
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: "#/components/schemas/ContestTeam"
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
description: コンテストのチーム情報を追加します
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AddContestTeamRequest"
tags:
- contest
"/contests/{contestId}/teams/{teamId}":
parameters:
- $ref: "#/components/parameters/contestIdInPath"
- $ref: "#/components/parameters/teamIdInPath"
get:
summary: コンテストチーム詳細情報の取得
tags:
- contest
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ContestTeamDetail"
"404":
description: Not Found
operationId: getContestTeam
description: コンテストチーム詳細情報を取得します
patch:
summary: コンテストチームの修正
operationId: editContestTeam
responses:
"204":
description: No Content
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
description: コンテストチームを修正します
tags:
- contest
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EditContestTeamRequest"
delete:
summary: コンテストチームの削除
operationId: deleteContestTeam
responses:
"204":
description: No Content
"403":
description: Forbidden
"404":
description: Not Found
description: コンテストチームを削除します
tags:
- contest
"/contests/{contestId}/teams/{teamId}/members":
parameters:
- $ref: "#/components/parameters/contestIdInPath"
- $ref: "#/components/parameters/teamIdInPath"
get:
summary: コンテストチームメンバーの取得
tags:
- contest
- user
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/User"
"403":
description: Forbidden
"404":
description: Not Found
operationId: getContestTeamMembers
description: コンテストチームメンバーを取得します
put:
summary: コンテストチームメンバーの修正
operationId: editContestTeamMembers
responses:
"204":
description: No Content
"403":
description: Forbidden
"404":
description: Not Found
description: コンテストチームメンバーを修正します
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EditContestTeamMembersRequest"
tags:
- contest
- user
"/users/{userId}/accounts/{accountId}":
parameters:
- $ref: "#/components/parameters/userIdInPath"
- $ref: "#/components/parameters/accountIdInPath"
get:
summary: ユーザーアカウント詳細情報の取得
tags:
- user
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Account"
"403":
description: Forbidden
"404":
description: Not Found
operationId: getUserAccount
description: ユーザーアカウントの詳細情報を取得します
patch:
summary: アカウント情報の修正
operationId: editUserAccount
responses:
"204":
description: No Content
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
description: アカウント情報を修正します
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EditUserAccountRequest"
description: ""
tags:
- user
delete:
summary: ユーザーアカウントの削除
operationId: deleteUserAccount
responses:
"204":
description: No Content
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
description: アカウントを削除します
tags:
- user
"/projects/{projectId}/members":
parameters:
- $ref: "#/components/parameters/projectIdInPath"
get:
summary: プロジェクトメンバーの取得
tags:
- project
- user
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
description: プロジェクトメンバーの配列
items:
$ref: "#/components/schemas/ProjectMember"
operationId: getProjectMembers
description: プロジェクトメンバーを取得します
put:
summary: プロジェクトメンバーの編集
operationId: editProjectMembers
description: プロジェクトメンバーを編集します
responses:
"204":
description: No Content
"400":
description: Bad Request
"403":
description: Forbidden
"404":
description: Not Found
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EditProjectMembersRequest"
tags:
- project
- user
/ping:
get:
summary: サーバー疎通確認
operationId: ping
responses:
"200":
description: OK
content:
application/json:
schema:
type: string
description: サーバーの疎通確認を行います
tags:
- ping
components:
schemas:
User:
title: User
type: object
description: ユーザー情報
properties:
id:
type: string
description: ユーザーUUID
format: uuid
x-go-type: uuid.UUID
name:
type: string
pattern: "^[a-zA-Z0-9_-]{1,32}$"
description: ユーザー名
realName:
type: string
description: 本名
required:
- id
- name
- realName
UserDetail:
title: UserDetail
type: object
description: ユーザー詳細情報
allOf:
- $ref: "#/components/schemas/User"
- type: object
properties:
state:
$ref: "#/components/schemas/UserAccountState"
bio:
type: string
description: 自己紹介(biography)
maxLength: 1000
accounts:
type: array
description: 各種アカウントへのリンク
items:
$ref: "#/components/schemas/Account"
required:
- state
- bio
- accounts
UserAccountState:
type: integer
title: UserAccountState
description: |-
ユーザーアカウント状態
0: 凍結
1: 有効
2: 一時停止
enum:
- 0
- 1
- 2
x-enum-varnames:
- deactivated
- active
- suspended
x-enum-descriptions:
- 凍結
- 有効
- 一時停止
format: int32
Account:
title: Account
type: object
description: アカウントへのリンク
properties:
id:
type: string
description: アカウントUUID
format: uuid
x-go-type: uuid.UUID
displayName:
type: string
description: 外部アカウントの表示名
type:
$ref: "#/components/schemas/AccountType"
prPermitted:
$ref: "#/components/schemas/PrPermitted"
url:
type: string
description: アカウントurl
required:
- id
- displayName
- type
- prPermitted
- url
AccountType:
type: integer
title: AccountType
description: アカウントの種類
enum:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
x-enum-varnames:
- homepage
- blog
- twitter
- facebook
- pixiv
- github
- qiita
- zenn
- atcoder
- soundcloud
- hackthebox
- ctftime
x-enum-descriptions:
- ホームページ (IDはリンクのURLそのまま)
- ブログ (IDはリンクのURLそのまま)
- Twitter (IDは@~のもの、@は含まない)
- Facebook
- Pixiv
- GitHub (@は含まない)
- Qiita (@は含まない)
- Zenn
- AtCoder
- SoundCloud
- HackTheBox
- CTFtime
x-go-type: uint8
Project:
title: Project
type: object
description: プロジェクト情報
properties:
id:
type: string
format: uuid
x-go-type: uuid.UUID
description: プロジェクトuuid
name:
type: string
description: プロジェクト名
duration:
$ref: "#/components/schemas/YearWithSemesterDuration"
required:
- id
- name
- duration
UserProject:
title: UserProject
type: object
description: ユーザのプロジェクトの情報
allOf:
- $ref: "#/components/schemas/Project"
- type: object
properties:
userDuration:
$ref: "#/components/schemas/YearWithSemesterDuration"
required:
- userDuration
ProjectDetail:
title: ProjectDetail
type: object
description: プロジェクトの詳細情報
allOf:
- $ref: "#/components/schemas/Project"
- type: object
properties:
link:
type: string
format: uri
description: プロジェクトの詳細が載っているページへのリンク
description:
type: string
description: プロジェクト説明
members:
type: array
description: プロジェクトメンバー
items:
$ref: "#/components/schemas/ProjectMember"
required:
- link
- description
- members
ProjectMember:
title: ProjectMember
type: object
description: プロジェクトメンバー情報
allOf:
- $ref: "#/components/schemas/User"
- type: object
properties:
duration:
$ref: "#/components/schemas/YearWithSemesterDuration"
required:
- duration
Event:
type: object
description: イベント情報
title: Event
properties:
id:
type: string
format: uuid
x-go-type: uuid.UUID
description: イベントuuid
name:
type: string
example: 第n回進捗会
description: イベント名
duration:
# description: イベントの開催期間
$ref: "#/components/schemas/Duration"
level:
$ref: "#/components/schemas/EventLevel"
required:
- id
- name
- duration
- level
EventDetail:
description: イベントの詳細情報
title: EventDetail
allOf:
- $ref: "#/components/schemas/Event"
- properties:
description:
type: string
example: 第n回の進捗会です。
description: イベント説明
place:
type: string
description: 大学、オンラインなどの大まかな場所
hostname:
type: array
description: 主催者
items:
$ref: "#/components/schemas/User"
required:
- description
- place
- hostname