diff options
Diffstat (limited to 'docs/swagger.json')
| -rw-r--r-- | docs/swagger.json | 228 |
1 files changed, 222 insertions, 6 deletions
diff --git a/docs/swagger.json b/docs/swagger.json index 0bebe1c..ba0e8a3 100644 --- a/docs/swagger.json +++ b/docs/swagger.json | |||
| @@ -13,6 +13,55 @@ | |||
| 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}": { | ||
| 17 | "get": { | ||
| 18 | "produces": [ | ||
| 19 | "application/json" | ||
| 20 | ], | ||
| 21 | "tags": [ | ||
| 22 | "chapters" | ||
| 23 | ], | ||
| 24 | "summary": "Get chapters from the specified game id.", | ||
| 25 | "parameters": [ | ||
| 26 | { | ||
| 27 | "type": "integer", | ||
| 28 | "description": "Game ID", | ||
| 29 | "name": "id", | ||
| 30 | "in": "path", | ||
| 31 | "required": true | ||
| 32 | } | ||
| 33 | ], | ||
| 34 | "responses": { | ||
| 35 | "200": { | ||
| 36 | "description": "OK", | ||
| 37 | "schema": { | ||
| 38 | "allOf": [ | ||
| 39 | { | ||
| 40 | "$ref": "#/definitions/models.Response" | ||
| 41 | }, | ||
| 42 | { | ||
| 43 | "type": "object", | ||
| 44 | "properties": { | ||
| 45 | "data": { | ||
| 46 | "type": "array", | ||
| 47 | "items": { | ||
| 48 | "$ref": "#/definitions/models.Chapter" | ||
| 49 | } | ||
| 50 | } | ||
| 51 | } | ||
| 52 | } | ||
| 53 | ] | ||
| 54 | } | ||
| 55 | }, | ||
| 56 | "400": { | ||
| 57 | "description": "Bad Request", | ||
| 58 | "schema": { | ||
| 59 | "$ref": "#/definitions/models.Response" | ||
| 60 | } | ||
| 61 | } | ||
| 62 | } | ||
| 63 | } | ||
| 64 | }, | ||
| 16 | "/demo": { | 65 | "/demo": { |
| 17 | "get": { | 66 | "get": { |
| 18 | "produces": [ | 67 | "produces": [ |
| @@ -87,6 +136,46 @@ | |||
| 87 | } | 136 | } |
| 88 | } | 137 | } |
| 89 | }, | 138 | }, |
| 139 | "/games": { | ||
| 140 | "get": { | ||
| 141 | "produces": [ | ||
| 142 | "application/json" | ||
| 143 | ], | ||
| 144 | "tags": [ | ||
| 145 | "games" | ||
| 146 | ], | ||
| 147 | "summary": "Get games from the leaderboards.", | ||
| 148 | "responses": { | ||
| 149 | "200": { | ||
| 150 | "description": "OK", | ||
| 151 | "schema": { | ||
| 152 | "allOf": [ | ||
| 153 | { | ||
| 154 | "$ref": "#/definitions/models.Response" | ||
| 155 | }, | ||
| 156 | { | ||
| 157 | "type": "object", | ||
| 158 | "properties": { | ||
| 159 | "data": { | ||
| 160 | "type": "array", | ||
| 161 | "items": { | ||
| 162 | "$ref": "#/definitions/models.Game" | ||
| 163 | } | ||
| 164 | } | ||
| 165 | } | ||
| 166 | } | ||
| 167 | ] | ||
| 168 | } | ||
| 169 | }, | ||
| 170 | "400": { | ||
| 171 | "description": "Bad Request", | ||
| 172 | "schema": { | ||
| 173 | "$ref": "#/definitions/models.Response" | ||
| 174 | } | ||
| 175 | } | ||
| 176 | } | ||
| 177 | } | ||
| 178 | }, | ||
| 90 | "/login": { | 179 | "/login": { |
| 91 | "get": { | 180 | "get": { |
| 92 | "consumes": [ | 181 | "consumes": [ |
| @@ -127,11 +216,57 @@ | |||
| 127 | } | 216 | } |
| 128 | } | 217 | } |
| 129 | }, | 218 | }, |
| 130 | "/maps/{id}/leaderboards": { | 219 | "/maps/{id}": { |
| 131 | "get": { | 220 | "get": { |
| 132 | "consumes": [ | 221 | "produces": [ |
| 133 | "application/json" | 222 | "application/json" |
| 134 | ], | 223 | ], |
| 224 | "tags": [ | ||
| 225 | "maps" | ||
| 226 | ], | ||
| 227 | "summary": "Get maps from the specified chapter id.", | ||
| 228 | "parameters": [ | ||
| 229 | { | ||
| 230 | "type": "integer", | ||
| 231 | "description": "Chapter ID", | ||
| 232 | "name": "id", | ||
| 233 | "in": "path", | ||
| 234 | "required": true | ||
| 235 | } | ||
| 236 | ], | ||
| 237 | "responses": { | ||
| 238 | "200": { | ||
| 239 | "description": "OK", | ||
| 240 | "schema": { | ||
| 241 | "allOf": [ | ||
| 242 | { | ||
| 243 | "$ref": "#/definitions/models.Response" | ||
| 244 | }, | ||
| 245 | { | ||
| 246 | "type": "object", | ||
| 247 | "properties": { | ||
| 248 | "data": { | ||
| 249 | "type": "array", | ||
| 250 | "items": { | ||
| 251 | "$ref": "#/definitions/models.MapShort" | ||
| 252 | } | ||
| 253 | } | ||
| 254 | } | ||
| 255 | } | ||
| 256 | ] | ||
| 257 | } | ||
| 258 | }, | ||
| 259 | "400": { | ||
| 260 | "description": "Bad Request", | ||
| 261 | "schema": { | ||
| 262 | "$ref": "#/definitions/models.Response" | ||
| 263 | } | ||
| 264 | } | ||
| 265 | } | ||
| 266 | } | ||
| 267 | }, | ||
| 268 | "/maps/{id}/leaderboards": { | ||
| 269 | "get": { | ||
| 135 | "produces": [ | 270 | "produces": [ |
| 136 | "application/json" | 271 | "application/json" |
| 137 | ], | 272 | ], |
| @@ -283,9 +418,6 @@ | |||
| 283 | }, | 418 | }, |
| 284 | "/maps/{id}/summary": { | 419 | "/maps/{id}/summary": { |
| 285 | "get": { | 420 | "get": { |
| 286 | "consumes": [ | ||
| 287 | "application/json" | ||
| 288 | ], | ||
| 289 | "produces": [ | 421 | "produces": [ |
| 290 | "application/json" | 422 | "application/json" |
| 291 | ], | 423 | ], |
| @@ -523,7 +655,19 @@ | |||
| 523 | "200": { | 655 | "200": { |
| 524 | "description": "OK", | 656 | "description": "OK", |
| 525 | "schema": { | 657 | "schema": { |
| 526 | "$ref": "#/definitions/models.Response" | 658 | "allOf": [ |
| 659 | { | ||
| 660 | "$ref": "#/definitions/models.Response" | ||
| 661 | }, | ||
| 662 | { | ||
| 663 | "type": "object", | ||
| 664 | "properties": { | ||
| 665 | "data": { | ||
| 666 | "$ref": "#/definitions/models.SearchResponse" | ||
| 667 | } | ||
| 668 | } | ||
| 669 | } | ||
| 670 | ] | ||
| 527 | } | 671 | } |
| 528 | }, | 672 | }, |
| 529 | "400": { | 673 | "400": { |
| @@ -592,6 +736,31 @@ | |||
| 592 | } | 736 | } |
| 593 | }, | 737 | }, |
| 594 | "definitions": { | 738 | "definitions": { |
| 739 | "models.Chapter": { | ||
| 740 | "type": "object", | ||
| 741 | "properties": { | ||
| 742 | "game_id": { | ||
| 743 | "type": "integer" | ||
| 744 | }, | ||
| 745 | "id": { | ||
| 746 | "type": "integer" | ||
| 747 | }, | ||
| 748 | "name": { | ||
| 749 | "type": "string" | ||
| 750 | } | ||
| 751 | } | ||
| 752 | }, | ||
| 753 | "models.Game": { | ||
| 754 | "type": "object", | ||
| 755 | "properties": { | ||
| 756 | "id": { | ||
| 757 | "type": "integer" | ||
| 758 | }, | ||
| 759 | "name": { | ||
| 760 | "type": "string" | ||
| 761 | } | ||
| 762 | } | ||
| 763 | }, | ||
| 595 | "models.LoginResponse": { | 764 | "models.LoginResponse": { |
| 596 | "type": "object", | 765 | "type": "object", |
| 597 | "properties": { | 766 | "properties": { |
| @@ -655,6 +824,20 @@ | |||
| 655 | "records": {} | 824 | "records": {} |
| 656 | } | 825 | } |
| 657 | }, | 826 | }, |
| 827 | "models.MapShort": { | ||
| 828 | "type": "object", | ||
| 829 | "properties": { | ||
| 830 | "chapter_id": { | ||
| 831 | "type": "integer" | ||
| 832 | }, | ||
| 833 | "id": { | ||
| 834 | "type": "integer" | ||
| 835 | }, | ||
| 836 | "name": { | ||
| 837 | "type": "string" | ||
| 838 | } | ||
| 839 | } | ||
| 840 | }, | ||
| 658 | "models.MapSummary": { | 841 | "models.MapSummary": { |
| 659 | "type": "object", | 842 | "type": "object", |
| 660 | "properties": { | 843 | "properties": { |
| @@ -777,6 +960,39 @@ | |||
| 777 | "records": {} | 960 | "records": {} |
| 778 | } | 961 | } |
| 779 | }, | 962 | }, |
| 963 | "models.SearchResponse": { | ||
| 964 | "type": "object", | ||
| 965 | "properties": { | ||
| 966 | "maps": { | ||
| 967 | "type": "array", | ||
| 968 | "items": { | ||
| 969 | "type": "object", | ||
| 970 | "properties": { | ||
| 971 | "id": { | ||
| 972 | "type": "integer" | ||
| 973 | }, | ||
| 974 | "name": { | ||
| 975 | "type": "string" | ||
| 976 | } | ||
| 977 | } | ||
| 978 | } | ||
| 979 | }, | ||
| 980 | "players": { | ||
| 981 | "type": "array", | ||
| 982 | "items": { | ||
| 983 | "type": "object", | ||
| 984 | "properties": { | ||
| 985 | "steam_id": { | ||
| 986 | "type": "string" | ||
| 987 | }, | ||
| 988 | "user_name": { | ||
| 989 | "type": "string" | ||
| 990 | } | ||
| 991 | } | ||
| 992 | } | ||
| 993 | } | ||
| 994 | } | ||
| 995 | }, | ||
| 780 | "models.UserRanking": { | 996 | "models.UserRanking": { |
| 781 | "type": "object", | 997 | "type": "object", |
| 782 | "properties": { | 998 | "properties": { |