aboutsummaryrefslogtreecommitdiff
path: root/docs/swagger.json
diff options
context:
space:
mode:
Diffstat (limited to 'docs/swagger.json')
-rw-r--r--docs/swagger.json527
1 files changed, 376 insertions, 151 deletions
diff --git a/docs/swagger.json b/docs/swagger.json
index ae83321..226cadd 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -13,7 +13,7 @@
13 "host": "lp.ardapektezol.com/api", 13 "host": "lp.ardapektezol.com/api",
14 "basePath": "/v1", 14 "basePath": "/v1",
15 "paths": { 15 "paths": {
16 "/chapters/{id}": { 16 "/chapters/{chapterid}": {
17 "get": { 17 "get": {
18 "description": "Get maps from the specified chapter id.", 18 "description": "Get maps from the specified chapter id.",
19 "produces": [ 19 "produces": [
@@ -26,7 +26,7 @@
26 { 26 {
27 "type": "integer", 27 "type": "integer",
28 "description": "Chapter ID", 28 "description": "Chapter ID",
29 "name": "id", 29 "name": "chapterid",
30 "in": "path", 30 "in": "path",
31 "required": true 31 "required": true
32 } 32 }
@@ -86,12 +86,6 @@
86 "schema": { 86 "schema": {
87 "type": "file" 87 "type": "file"
88 } 88 }
89 },
90 "400": {
91 "description": "Bad Request",
92 "schema": {
93 "$ref": "#/definitions/models.Response"
94 }
95 } 89 }
96 } 90 }
97 } 91 }
@@ -136,7 +130,7 @@
136 } 130 }
137 } 131 }
138 }, 132 },
139 "/games/{id}": { 133 "/games/{gameid}": {
140 "get": { 134 "get": {
141 "description": "Get chapters from the specified game id.", 135 "description": "Get chapters from the specified game id.",
142 "produces": [ 136 "produces": [
@@ -149,7 +143,7 @@
149 { 143 {
150 "type": "integer", 144 "type": "integer",
151 "description": "Game ID", 145 "description": "Game ID",
152 "name": "id", 146 "name": "gameid",
153 "in": "path", 147 "in": "path",
154 "required": true 148 "required": true
155 } 149 }
@@ -172,12 +166,6 @@
172 } 166 }
173 ] 167 ]
174 } 168 }
175 },
176 "400": {
177 "description": "Bad Request",
178 "schema": {
179 "$ref": "#/definitions/models.Response"
180 }
181 } 169 }
182 } 170 }
183 } 171 }
@@ -212,12 +200,6 @@
212 } 200 }
213 ] 201 ]
214 } 202 }
215 },
216 "400": {
217 "description": "Bad Request",
218 "schema": {
219 "$ref": "#/definitions/models.Response"
220 }
221 } 203 }
222 } 204 }
223 } 205 }
@@ -258,12 +240,6 @@
258 } 240 }
259 ] 241 ]
260 } 242 }
261 },
262 "400": {
263 "description": "Bad Request",
264 "schema": {
265 "$ref": "#/definitions/models.Response"
266 }
267 } 243 }
268 } 244 }
269 } 245 }
@@ -295,19 +271,159 @@
295 } 271 }
296 ] 272 ]
297 } 273 }
274 }
275 }
276 }
277 },
278 "/maps/{mapid}/discussions": {
279 "get": {
280 "description": "Get map discussions with specified map id.",
281 "produces": [
282 "application/json"
283 ],
284 "tags": [
285 "maps"
286 ],
287 "parameters": [
288 {
289 "type": "integer",
290 "description": "Map ID",
291 "name": "mapid",
292 "in": "path",
293 "required": true
294 }
295 ],
296 "responses": {
297 "200": {
298 "description": "OK",
299 "schema": {
300 "allOf": [
301 {
302 "$ref": "#/definitions/models.Response"
303 },
304 {
305 "type": "object",
306 "properties": {
307 "data": {
308 "$ref": "#/definitions/handlers.MapDiscussionsResponse"
309 }
310 }
311 }
312 ]
313 }
314 }
315 }
316 },
317 "post": {
318 "description": "Create map discussion with specified map id.",
319 "produces": [
320 "application/json"
321 ],
322 "tags": [
323 "maps"
324 ],
325 "parameters": [
326 {
327 "type": "string",
328 "description": "JWT Token",
329 "name": "Authorization",
330 "in": "header",
331 "required": true
298 }, 332 },
299 "400": { 333 {
300 "description": "Bad Request", 334 "type": "integer",
335 "description": "Map ID",
336 "name": "mapid",
337 "in": "path",
338 "required": true
339 },
340 {
341 "type": "integer",
342 "description": "Discussion ID",
343 "name": "discussionid",
344 "in": "path",
345 "required": true
346 },
347 {
348 "description": "Body",
349 "name": "request",
350 "in": "body",
351 "required": true,
301 "schema": { 352 "schema": {
302 "$ref": "#/definitions/models.Response" 353 "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
354 }
355 }
356 ],
357 "responses": {
358 "200": {
359 "description": "OK",
360 "schema": {
361 "allOf": [
362 {
363 "$ref": "#/definitions/models.Response"
364 },
365 {
366 "type": "object",
367 "properties": {
368 "data": {
369 "$ref": "#/definitions/handlers.CreateMapDiscussionRequest"
370 }
371 }
372 }
373 ]
303 } 374 }
304 } 375 }
305 } 376 }
306 } 377 }
307 }, 378 },
308 "/maps/{id}/image": { 379 "/maps/{mapid}/discussions/{discussionid}": {
380 "get": {
381 "description": "Get map discussion with specified map and discussion id.",
382 "produces": [
383 "application/json"
384 ],
385 "tags": [
386 "maps"
387 ],
388 "parameters": [
389 {
390 "type": "integer",
391 "description": "Map ID",
392 "name": "mapid",
393 "in": "path",
394 "required": true
395 },
396 {
397 "type": "integer",
398 "description": "Discussion ID",
399 "name": "discussionid",
400 "in": "path",
401 "required": true
402 }
403 ],
404 "responses": {
405 "200": {
406 "description": "OK",
407 "schema": {
408 "allOf": [
409 {
410 "$ref": "#/definitions/models.Response"
411 },
412 {
413 "type": "object",
414 "properties": {
415 "data": {
416 "$ref": "#/definitions/handlers.MapDiscussionResponse"
417 }
418 }
419 }
420 ]
421 }
422 }
423 }
424 },
309 "put": { 425 "put": {
310 "description": "Edit map image with specified map id.", 426 "description": "Edit map discussion with specified map id.",
311 "produces": [ 427 "produces": [
312 "application/json" 428 "application/json"
313 ], 429 ],
@@ -325,7 +441,14 @@
325 { 441 {
326 "type": "integer", 442 "type": "integer",
327 "description": "Map ID", 443 "description": "Map ID",
328 "name": "id", 444 "name": "mapid",
445 "in": "path",
446 "required": true
447 },
448 {
449 "type": "integer",
450 "description": "Discussion ID",
451 "name": "discussionid",
329 "in": "path", 452 "in": "path",
330 "required": true 453 "required": true
331 }, 454 },
@@ -335,7 +458,7 @@
335 "in": "body", 458 "in": "body",
336 "required": true, 459 "required": true,
337 "schema": { 460 "schema": {
338 "$ref": "#/definitions/handlers.EditMapImageRequest" 461 "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
339 } 462 }
340 } 463 }
341 ], 464 ],
@@ -351,15 +474,49 @@
351 "type": "object", 474 "type": "object",
352 "properties": { 475 "properties": {
353 "data": { 476 "data": {
354 "$ref": "#/definitions/handlers.EditMapImageRequest" 477 "$ref": "#/definitions/handlers.EditMapDiscussionRequest"
355 } 478 }
356 } 479 }
357 } 480 }
358 ] 481 ]
359 } 482 }
483 }
484 }
485 },
486 "delete": {
487 "description": "Delete map summary with specified map id.",
488 "produces": [
489 "application/json"
490 ],
491 "tags": [
492 "maps"
493 ],
494 "parameters": [
495 {
496 "type": "string",
497 "description": "JWT Token",
498 "name": "Authorization",
499 "in": "header",
500 "required": true
360 }, 501 },
361 "400": { 502 {
362 "description": "Bad Request", 503 "type": "integer",
504 "description": "Map ID",
505 "name": "mapid",
506 "in": "path",
507 "required": true
508 },
509 {
510 "type": "integer",
511 "description": "Discussion ID",
512 "name": "discussionid",
513 "in": "path",
514 "required": true
515 }
516 ],
517 "responses": {
518 "200": {
519 "description": "OK",
363 "schema": { 520 "schema": {
364 "$ref": "#/definitions/models.Response" 521 "$ref": "#/definitions/models.Response"
365 } 522 }
@@ -367,7 +524,63 @@
367 } 524 }
368 } 525 }
369 }, 526 },
370 "/maps/{id}/leaderboards": { 527 "/maps/{mapid}/image": {
528 "put": {
529 "description": "Edit map image with specified map id.",
530 "produces": [
531 "application/json"
532 ],
533 "tags": [
534 "maps"
535 ],
536 "parameters": [
537 {
538 "type": "string",
539 "description": "JWT Token",
540 "name": "Authorization",
541 "in": "header",
542 "required": true
543 },
544 {
545 "type": "integer",
546 "description": "Map ID",
547 "name": "mapid",
548 "in": "path",
549 "required": true
550 },
551 {
552 "description": "Body",
553 "name": "request",
554 "in": "body",
555 "required": true,
556 "schema": {
557 "$ref": "#/definitions/handlers.EditMapImageRequest"
558 }
559 }
560 ],
561 "responses": {
562 "200": {
563 "description": "OK",
564 "schema": {
565 "allOf": [
566 {
567 "$ref": "#/definitions/models.Response"
568 },
569 {
570 "type": "object",
571 "properties": {
572 "data": {
573 "$ref": "#/definitions/handlers.EditMapImageRequest"
574 }
575 }
576 }
577 ]
578 }
579 }
580 }
581 }
582 },
583 "/maps/{mapid}/leaderboards": {
371 "get": { 584 "get": {
372 "description": "Get map leaderboards with specified id.", 585 "description": "Get map leaderboards with specified id.",
373 "produces": [ 586 "produces": [
@@ -380,7 +593,7 @@
380 { 593 {
381 "type": "integer", 594 "type": "integer",
382 "description": "Map ID", 595 "description": "Map ID",
383 "name": "id", 596 "name": "mapid",
384 "in": "path", 597 "in": "path",
385 "required": true 598 "required": true
386 }, 599 },
@@ -415,17 +628,11 @@
415 } 628 }
416 ] 629 ]
417 } 630 }
418 },
419 "400": {
420 "description": "Bad Request",
421 "schema": {
422 "$ref": "#/definitions/models.Response"
423 }
424 } 631 }
425 } 632 }
426 } 633 }
427 }, 634 },
428 "/maps/{id}/record": { 635 "/maps/{mapid}/record": {
429 "post": { 636 "post": {
430 "description": "Post record with demo of a specific map.", 637 "description": "Post record with demo of a specific map.",
431 "consumes": [ 638 "consumes": [
@@ -441,7 +648,7 @@
441 { 648 {
442 "type": "integer", 649 "type": "integer",
443 "description": "Map ID", 650 "description": "Map ID",
444 "name": "id", 651 "name": "mapid",
445 "in": "path", 652 "in": "path",
446 "required": true 653 "required": true
447 }, 654 },
@@ -496,23 +703,11 @@
496 } 703 }
497 ] 704 ]
498 } 705 }
499 },
500 "400": {
501 "description": "Bad Request",
502 "schema": {
503 "$ref": "#/definitions/models.Response"
504 }
505 },
506 "401": {
507 "description": "Unauthorized",
508 "schema": {
509 "$ref": "#/definitions/models.Response"
510 }
511 } 706 }
512 } 707 }
513 } 708 }
514 }, 709 },
515 "/maps/{id}/summary": { 710 "/maps/{mapid}/summary": {
516 "get": { 711 "get": {
517 "description": "Get map summary with specified id.", 712 "description": "Get map summary with specified id.",
518 "produces": [ 713 "produces": [
@@ -525,7 +720,7 @@
525 { 720 {
526 "type": "integer", 721 "type": "integer",
527 "description": "Map ID", 722 "description": "Map ID",
528 "name": "id", 723 "name": "mapid",
529 "in": "path", 724 "in": "path",
530 "required": true 725 "required": true
531 } 726 }
@@ -548,12 +743,6 @@
548 } 743 }
549 ] 744 ]
550 } 745 }
551 },
552 "400": {
553 "description": "Bad Request",
554 "schema": {
555 "$ref": "#/definitions/models.Response"
556 }
557 } 746 }
558 } 747 }
559 }, 748 },
@@ -576,7 +765,7 @@
576 { 765 {
577 "type": "integer", 766 "type": "integer",
578 "description": "Map ID", 767 "description": "Map ID",
579 "name": "id", 768 "name": "mapid",
580 "in": "path", 769 "in": "path",
581 "required": true 770 "required": true
582 }, 771 },
@@ -608,12 +797,6 @@
608 } 797 }
609 ] 798 ]
610 } 799 }
611 },
612 "400": {
613 "description": "Bad Request",
614 "schema": {
615 "$ref": "#/definitions/models.Response"
616 }
617 } 800 }
618 } 801 }
619 }, 802 },
@@ -636,7 +819,7 @@
636 { 819 {
637 "type": "integer", 820 "type": "integer",
638 "description": "Map ID", 821 "description": "Map ID",
639 "name": "id", 822 "name": "mapid",
640 "in": "path", 823 "in": "path",
641 "required": true 824 "required": true
642 }, 825 },
@@ -668,12 +851,6 @@
668 } 851 }
669 ] 852 ]
670 } 853 }
671 },
672 "400": {
673 "description": "Bad Request",
674 "schema": {
675 "$ref": "#/definitions/models.Response"
676 }
677 } 854 }
678 } 855 }
679 }, 856 },
@@ -696,7 +873,7 @@
696 { 873 {
697 "type": "integer", 874 "type": "integer",
698 "description": "Map ID", 875 "description": "Map ID",
699 "name": "id", 876 "name": "mapid",
700 "in": "path", 877 "in": "path",
701 "required": true 878 "required": true
702 }, 879 },
@@ -728,12 +905,6 @@
728 } 905 }
729 ] 906 ]
730 } 907 }
731 },
732 "400": {
733 "description": "Bad Request",
734 "schema": {
735 "$ref": "#/definitions/models.Response"
736 }
737 } 908 }
738 } 909 }
739 } 910 }
@@ -777,18 +948,6 @@
777 } 948 }
778 ] 949 ]
779 } 950 }
780 },
781 "400": {
782 "description": "Bad Request",
783 "schema": {
784 "$ref": "#/definitions/models.Response"
785 }
786 },
787 "401": {
788 "description": "Unauthorized",
789 "schema": {
790 "$ref": "#/definitions/models.Response"
791 }
792 } 951 }
793 } 952 }
794 }, 953 },
@@ -825,18 +984,6 @@
825 "schema": { 984 "schema": {
826 "$ref": "#/definitions/models.Response" 985 "$ref": "#/definitions/models.Response"
827 } 986 }
828 },
829 "400": {
830 "description": "Bad Request",
831 "schema": {
832 "$ref": "#/definitions/models.Response"
833 }
834 },
835 "401": {
836 "description": "Unauthorized",
837 "schema": {
838 "$ref": "#/definitions/models.Response"
839 }
840 } 987 }
841 } 988 }
842 }, 989 },
@@ -878,18 +1025,6 @@
878 } 1025 }
879 ] 1026 ]
880 } 1027 }
881 },
882 "400": {
883 "description": "Bad Request",
884 "schema": {
885 "$ref": "#/definitions/models.Response"
886 }
887 },
888 "401": {
889 "description": "Unauthorized",
890 "schema": {
891 "$ref": "#/definitions/models.Response"
892 }
893 } 1028 }
894 } 1029 }
895 } 1030 }
@@ -921,12 +1056,6 @@
921 } 1056 }
922 ] 1057 ]
923 } 1058 }
924 },
925 "400": {
926 "description": "Bad Request",
927 "schema": {
928 "$ref": "#/definitions/models.Response"
929 }
930 } 1059 }
931 } 1060 }
932 } 1061 }
@@ -966,12 +1095,6 @@
966 } 1095 }
967 ] 1096 ]
968 } 1097 }
969 },
970 "400": {
971 "description": "Bad Request",
972 "schema": {
973 "$ref": "#/definitions/models.Response"
974 }
975 } 1098 }
976 } 1099 }
977 } 1100 }
@@ -1048,7 +1171,7 @@
1048 } 1171 }
1049 } 1172 }
1050 }, 1173 },
1051 "/users/{id}": { 1174 "/users/{userid}": {
1052 "get": { 1175 "get": {
1053 "description": "Get profile page of another user.", 1176 "description": "Get profile page of another user.",
1054 "consumes": [ 1177 "consumes": [
@@ -1064,7 +1187,7 @@
1064 { 1187 {
1065 "type": "integer", 1188 "type": "integer",
1066 "description": "User ID", 1189 "description": "User ID",
1067 "name": "id", 1190 "name": "userid",
1068 "in": "path", 1191 "in": "path",
1069 "required": true 1192 "required": true
1070 } 1193 }
@@ -1087,18 +1210,6 @@
1087 } 1210 }
1088 ] 1211 ]
1089 } 1212 }
1090 },
1091 "400": {
1092 "description": "Bad Request",
1093 "schema": {
1094 "$ref": "#/definitions/models.Response"
1095 }
1096 },
1097 "404": {
1098 "description": "Not Found",
1099 "schema": {
1100 "$ref": "#/definitions/models.Response"
1101 }
1102 } 1213 }
1103 } 1214 }
1104 } 1215 }
@@ -1133,6 +1244,21 @@
1133 } 1244 }
1134 } 1245 }
1135 }, 1246 },
1247 "handlers.CreateMapDiscussionRequest": {
1248 "type": "object",
1249 "required": [
1250 "content",
1251 "title"
1252 ],
1253 "properties": {
1254 "content": {
1255 "type": "string"
1256 },
1257 "title": {
1258 "type": "string"
1259 }
1260 }
1261 },
1136 "handlers.CreateMapSummaryRequest": { 1262 "handlers.CreateMapSummaryRequest": {
1137 "type": "object", 1263 "type": "object",
1138 "required": [ 1264 "required": [
@@ -1174,6 +1300,21 @@
1174 } 1300 }
1175 } 1301 }
1176 }, 1302 },
1303 "handlers.EditMapDiscussionRequest": {
1304 "type": "object",
1305 "required": [
1306 "content",
1307 "title"
1308 ],
1309 "properties": {
1310 "content": {
1311 "type": "string"
1312 },
1313 "title": {
1314 "type": "string"
1315 }
1316 }
1317 },
1177 "handlers.EditMapImageRequest": { 1318 "handlers.EditMapImageRequest": {
1178 "type": "object", 1319 "type": "object",
1179 "required": [ 1320 "required": [
@@ -1248,6 +1389,90 @@
1248 } 1389 }
1249 } 1390 }
1250 }, 1391 },
1392 "handlers.MapDiscussion": {
1393 "type": "object",
1394 "properties": {
1395 "comments": {
1396 "type": "array",
1397 "items": {
1398 "$ref": "#/definitions/handlers.MapDiscussionComment"
1399 }
1400 },
1401 "content": {
1402 "type": "string"
1403 },
1404 "creator": {
1405 "$ref": "#/definitions/models.UserShortWithAvatar"
1406 },
1407 "id": {
1408 "type": "integer"
1409 },
1410 "title": {
1411 "type": "string"
1412 },
1413 "updated_at": {
1414 "description": "Upvotes int `json:\"upvotes\"`",
1415 "type": "string"
1416 }
1417 }
1418 },
1419 "handlers.MapDiscussionComment": {
1420 "type": "object",
1421 "properties": {
1422 "comment": {
1423 "type": "string"
1424 },
1425 "date": {
1426 "type": "string"
1427 },
1428 "user": {
1429 "$ref": "#/definitions/models.UserShortWithAvatar"
1430 }
1431 }
1432 },
1433 "handlers.MapDiscussionOnlyTitle": {
1434 "type": "object",
1435 "properties": {
1436 "comments": {
1437 "type": "array",
1438 "items": {
1439 "$ref": "#/definitions/handlers.MapDiscussionComment"
1440 }
1441 },
1442 "creator": {
1443 "$ref": "#/definitions/models.UserShortWithAvatar"
1444 },
1445 "id": {
1446 "type": "integer"
1447 },
1448 "title": {
1449 "type": "string"
1450 },
1451 "updated_at": {
1452 "description": "Upvotes int `json:\"upvotes\"`",
1453 "type": "string"
1454 }
1455 }
1456 },
1457 "handlers.MapDiscussionResponse": {
1458 "type": "object",
1459 "properties": {
1460 "discussion": {
1461 "$ref": "#/definitions/handlers.MapDiscussion"
1462 }
1463 }
1464 },
1465 "handlers.MapDiscussionsResponse": {
1466 "type": "object",
1467 "properties": {
1468 "discussions": {
1469 "type": "array",
1470 "items": {
1471 "$ref": "#/definitions/handlers.MapDiscussionOnlyTitle"
1472 }
1473 }
1474 }
1475 },
1251 "handlers.MapLeaderboardsResponse": { 1476 "handlers.MapLeaderboardsResponse": {
1252 "type": "object", 1477 "type": "object",
1253 "properties": { 1478 "properties": {