Skip to content

Commit

Permalink
fix: swagger document response type (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
Monirzadeh authored Jun 6, 2024
1 parent a1d7579 commit 47a0143
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
24 changes: 12 additions & 12 deletions docs/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api_v1.contentResponseMessage"
"$ref": "#/definitions/api_v1.readableResponseMessage"
}
},
"403": {
Expand Down Expand Up @@ -228,17 +228,6 @@ const docTemplate = `{
}
},
"definitions": {
"api_v1.contentResponseMessage": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"html": {
"type": "string"
}
}
},
"api_v1.loginRequestPayload": {
"type": "object",
"required": [
Expand Down Expand Up @@ -273,6 +262,17 @@ const docTemplate = `{
}
}
},
"api_v1.readableResponseMessage": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"html": {
"type": "string"
}
}
},
"api_v1.settingRequestPayload": {
"type": "object",
"properties": {
Expand Down
24 changes: 12 additions & 12 deletions docs/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api_v1.contentResponseMessage"
"$ref": "#/definitions/api_v1.readableResponseMessage"
}
},
"403": {
Expand Down Expand Up @@ -217,17 +217,6 @@
}
},
"definitions": {
"api_v1.contentResponseMessage": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"html": {
"type": "string"
}
}
},
"api_v1.loginRequestPayload": {
"type": "object",
"required": [
Expand Down Expand Up @@ -262,6 +251,17 @@
}
}
},
"api_v1.readableResponseMessage": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"html": {
"type": "string"
}
}
},
"api_v1.settingRequestPayload": {
"type": "object",
"properties": {
Expand Down
16 changes: 8 additions & 8 deletions docs/swagger/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
definitions:
api_v1.contentResponseMessage:
properties:
content:
type: string
html:
type: string
type: object
api_v1.loginRequestPayload:
properties:
password:
Expand All @@ -29,6 +22,13 @@ definitions:
token:
type: string
type: object
api_v1.readableResponseMessage:
properties:
content:
type: string
html:
type: string
type: object
api_v1.settingRequestPayload:
properties:
config:
Expand Down Expand Up @@ -233,7 +233,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/api_v1.contentResponseMessage'
$ref: '#/definitions/api_v1.readableResponseMessage'
"403":
description: Token not provided/invalid
summary: Get readable version of bookmark.
Expand Down
2 changes: 1 addition & 1 deletion internal/http/routes/api/v1/bookmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type readableResponseMessage struct {
// @Tags Auth
// @securityDefinitions.apikey ApiKeyAuth
// @Produce json
// @Success 200 {object} contentResponseMessage
// @Success 200 {object} readableResponseMessage
// @Failure 403 {object} nil "Token not provided/invalid"
// @Router /api/v1/bookmarks/id/readable [get]
func (r *BookmarksAPIRoutes) bookmarkReadable(c *gin.Context) {
Expand Down

0 comments on commit 47a0143

Please sign in to comment.