Skip to content

Commit 47a0143

Browse files
authored
fix: swagger document response type (#932)
1 parent a1d7579 commit 47a0143

4 files changed

Lines changed: 33 additions & 33 deletions

File tree

docs/swagger/docs.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const docTemplate = `{
172172
"200": {
173173
"description": "OK",
174174
"schema": {
175-
"$ref": "#/definitions/api_v1.contentResponseMessage"
175+
"$ref": "#/definitions/api_v1.readableResponseMessage"
176176
}
177177
},
178178
"403": {
@@ -228,17 +228,6 @@ const docTemplate = `{
228228
}
229229
},
230230
"definitions": {
231-
"api_v1.contentResponseMessage": {
232-
"type": "object",
233-
"properties": {
234-
"content": {
235-
"type": "string"
236-
},
237-
"html": {
238-
"type": "string"
239-
}
240-
}
241-
},
242231
"api_v1.loginRequestPayload": {
243232
"type": "object",
244233
"required": [
@@ -273,6 +262,17 @@ const docTemplate = `{
273262
}
274263
}
275264
},
265+
"api_v1.readableResponseMessage": {
266+
"type": "object",
267+
"properties": {
268+
"content": {
269+
"type": "string"
270+
},
271+
"html": {
272+
"type": "string"
273+
}
274+
}
275+
},
276276
"api_v1.settingRequestPayload": {
277277
"type": "object",
278278
"properties": {

docs/swagger/swagger.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"200": {
162162
"description": "OK",
163163
"schema": {
164-
"$ref": "#/definitions/api_v1.contentResponseMessage"
164+
"$ref": "#/definitions/api_v1.readableResponseMessage"
165165
}
166166
},
167167
"403": {
@@ -217,17 +217,6 @@
217217
}
218218
},
219219
"definitions": {
220-
"api_v1.contentResponseMessage": {
221-
"type": "object",
222-
"properties": {
223-
"content": {
224-
"type": "string"
225-
},
226-
"html": {
227-
"type": "string"
228-
}
229-
}
230-
},
231220
"api_v1.loginRequestPayload": {
232221
"type": "object",
233222
"required": [
@@ -262,6 +251,17 @@
262251
}
263252
}
264253
},
254+
"api_v1.readableResponseMessage": {
255+
"type": "object",
256+
"properties": {
257+
"content": {
258+
"type": "string"
259+
},
260+
"html": {
261+
"type": "string"
262+
}
263+
}
264+
},
265265
"api_v1.settingRequestPayload": {
266266
"type": "object",
267267
"properties": {

docs/swagger/swagger.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
definitions:
2-
api_v1.contentResponseMessage:
3-
properties:
4-
content:
5-
type: string
6-
html:
7-
type: string
8-
type: object
92
api_v1.loginRequestPayload:
103
properties:
114
password:
@@ -29,6 +22,13 @@ definitions:
2922
token:
3023
type: string
3124
type: object
25+
api_v1.readableResponseMessage:
26+
properties:
27+
content:
28+
type: string
29+
html:
30+
type: string
31+
type: object
3232
api_v1.settingRequestPayload:
3333
properties:
3434
config:
@@ -233,7 +233,7 @@ paths:
233233
"200":
234234
description: OK
235235
schema:
236-
$ref: '#/definitions/api_v1.contentResponseMessage'
236+
$ref: '#/definitions/api_v1.readableResponseMessage'
237237
"403":
238238
description: Token not provided/invalid
239239
summary: Get readable version of bookmark.

internal/http/routes/api/v1/bookmarks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type readableResponseMessage struct {
9797
// @Tags Auth
9898
// @securityDefinitions.apikey ApiKeyAuth
9999
// @Produce json
100-
// @Success 200 {object} contentResponseMessage
100+
// @Success 200 {object} readableResponseMessage
101101
// @Failure 403 {object} nil "Token not provided/invalid"
102102
// @Router /api/v1/bookmarks/id/readable [get]
103103
func (r *BookmarksAPIRoutes) bookmarkReadable(c *gin.Context) {

0 commit comments

Comments
 (0)