aboutsummaryrefslogtreecommitdiff
path: root/docs/swagger.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'docs/swagger.yaml')
-rw-r--r--docs/swagger.yaml177
1 files changed, 175 insertions, 2 deletions
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index e4d9f39..81d4073 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1,4 +1,46 @@
1host: localhost:4000 1basePath: /v1
2definitions:
3 models.LoginResponse:
4 properties:
5 token:
6 type: string
7 type: object
8 models.ProfileResponse:
9 properties:
10 avatar_link:
11 type: string
12 country_code:
13 type: string
14 profile:
15 type: boolean
16 scores_mp:
17 items:
18 $ref: '#/definitions/models.ScoreResponse'
19 type: array
20 scores_sp:
21 items:
22 $ref: '#/definitions/models.ScoreResponse'
23 type: array
24 steam_id:
25 type: string
26 username:
27 type: string
28 type: object
29 models.Response:
30 properties:
31 data: {}
32 message:
33 type: string
34 success:
35 type: boolean
36 type: object
37 models.ScoreResponse:
38 properties:
39 map_id:
40 type: integer
41 records: {}
42 type: object
43host: localhost:4000/api
2info: 44info:
3 contact: {} 45 contact: {}
4 description: Backend API endpoints for Least Portals Database. 46 description: Backend API endpoints for Least Portals Database.
@@ -7,5 +49,136 @@ info:
7 url: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 49 url: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
8 title: Least Portals Database API 50 title: Least Portals Database API
9 version: "1.0" 51 version: "1.0"
10paths: {} 52paths:
53 /login:
54 get:
55 consumes:
56 - application/json
57 produces:
58 - application/json
59 responses:
60 "200":
61 description: OK
62 schema:
63 allOf:
64 - $ref: '#/definitions/models.Response'
65 - properties:
66 data:
67 $ref: '#/definitions/models.LoginResponse'
68 type: object
69 "400":
70 description: Bad Request
71 schema:
72 $ref: '#/definitions/models.Response'
73 summary: Get (redirect) login page for Steam auth.
74 /profile:
75 get:
76 consumes:
77 - application/json
78 produces:
79 - application/json
80 responses:
81 "200":
82 description: OK
83 schema:
84 allOf:
85 - $ref: '#/definitions/models.Response'
86 - properties:
87 data:
88 $ref: '#/definitions/models.ProfileResponse'
89 type: object
90 "400":
91 description: Bad Request
92 schema:
93 $ref: '#/definitions/models.Response'
94 "401":
95 description: Unauthorized
96 schema:
97 $ref: '#/definitions/models.Response'
98 summary: Get profile page of session user.
99 post:
100 consumes:
101 - application/json
102 produces:
103 - application/json
104 responses:
105 "200":
106 description: OK
107 schema:
108 allOf:
109 - $ref: '#/definitions/models.Response'
110 - properties:
111 data:
112 $ref: '#/definitions/models.ProfileResponse'
113 type: object
114 "400":
115 description: Bad Request
116 schema:
117 $ref: '#/definitions/models.Response'
118 "401":
119 description: Unauthorized
120 schema:
121 $ref: '#/definitions/models.Response'
122 summary: Update profile page of session user.
123 put:
124 consumes:
125 - application/json
126 parameters:
127 - description: Country Code [XX]
128 in: query
129 name: country_code
130 required: true
131 type: string
132 produces:
133 - application/json
134 responses:
135 "200":
136 description: OK
137 schema:
138 allOf:
139 - $ref: '#/definitions/models.Response'
140 - properties:
141 data:
142 $ref: '#/definitions/models.ProfileResponse'
143 type: object
144 "400":
145 description: Bad Request
146 schema:
147 $ref: '#/definitions/models.Response'
148 "401":
149 description: Unauthorized
150 schema:
151 $ref: '#/definitions/models.Response'
152 summary: Update country code of session user.
153 /user/{id}:
154 get:
155 consumes:
156 - application/json
157 parameters:
158 - description: User ID
159 in: path
160 name: id
161 required: true
162 type: integer
163 produces:
164 - application/json
165 responses:
166 "200":
167 description: OK
168 schema:
169 allOf:
170 - $ref: '#/definitions/models.Response'
171 - properties:
172 data:
173 $ref: '#/definitions/models.ProfileResponse'
174 type: object
175 "400":
176 description: Bad Request
177 schema:
178 $ref: '#/definitions/models.Response'
179 "404":
180 description: Not Found
181 schema:
182 $ref: '#/definitions/models.Response'
183 summary: Get profile page of another user.
11swagger: "2.0" 184swagger: "2.0"