From 34555262c1d6a2dff9e2068019013f700962f13c Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:37:24 +0300 Subject: docs: add missing param (#59) --- backend/handlers/discussions.go | 1 + docs/docs.go | 33 ++++++++------------------------- docs/swagger.json | 33 ++++++++------------------------- docs/swagger.yaml | 23 ++++++----------------- 4 files changed, 23 insertions(+), 67 deletions(-) diff --git a/backend/handlers/discussions.go b/backend/handlers/discussions.go index 51f5334..04c91d0 100644 --- a/backend/handlers/discussions.go +++ b/backend/handlers/discussions.go @@ -189,6 +189,7 @@ func CreateMapDiscussion(c *gin.Context) { // @Produce json // @Param Authorization header string true "JWT Token" // @Param mapid path int true "Map ID" +// @Param discussionid path int true "Discussion ID" // @Param request body CreateMapDiscussionCommentRequest true "Body" // @Success 200 {object} models.Response{data=CreateMapDiscussionCommentRequest} // @Router /maps/{mapid}/discussions/{discussionid} [post] diff --git a/docs/docs.go b/docs/docs.go index c2c1bab..fc38d35 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -545,6 +545,13 @@ const docTemplate = `{ "in": "path", "required": true }, + { + "type": "integer", + "description": "Discussion ID", + "name": "discussionid", + "in": "path", + "required": true + }, { "description": "Body", "name": "request", @@ -1577,30 +1584,6 @@ const docTemplate = `{ } } }, - "handlers.MapDiscussionOnlyTitle": { - "type": "object", - "properties": { - "comments": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.MapDiscussionComment" - } - }, - "creator": { - "$ref": "#/definitions/models.UserShortWithAvatar" - }, - "id": { - "type": "integer" - }, - "title": { - "type": "string" - }, - "updated_at": { - "description": "Upvotes int ` + "`" + `json:\"upvotes\"` + "`" + `", - "type": "string" - } - } - }, "handlers.MapDiscussionResponse": { "type": "object", "properties": { @@ -1615,7 +1598,7 @@ const docTemplate = `{ "discussions": { "type": "array", "items": { - "$ref": "#/definitions/handlers.MapDiscussionOnlyTitle" + "$ref": "#/definitions/handlers.MapDiscussion" } } } diff --git a/docs/swagger.json b/docs/swagger.json index 043fb6b..32efc4b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -539,6 +539,13 @@ "in": "path", "required": true }, + { + "type": "integer", + "description": "Discussion ID", + "name": "discussionid", + "in": "path", + "required": true + }, { "description": "Body", "name": "request", @@ -1571,30 +1578,6 @@ } } }, - "handlers.MapDiscussionOnlyTitle": { - "type": "object", - "properties": { - "comments": { - "type": "array", - "items": { - "$ref": "#/definitions/handlers.MapDiscussionComment" - } - }, - "creator": { - "$ref": "#/definitions/models.UserShortWithAvatar" - }, - "id": { - "type": "integer" - }, - "title": { - "type": "string" - }, - "updated_at": { - "description": "Upvotes int `json:\"upvotes\"`", - "type": "string" - } - } - }, "handlers.MapDiscussionResponse": { "type": "object", "properties": { @@ -1609,7 +1592,7 @@ "discussions": { "type": "array", "items": { - "$ref": "#/definitions/handlers.MapDiscussionOnlyTitle" + "$ref": "#/definitions/handlers.MapDiscussion" } } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 9de09a3..f3a848f 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -149,22 +149,6 @@ definitions: user: $ref: '#/definitions/models.UserShortWithAvatar' type: object - handlers.MapDiscussionOnlyTitle: - properties: - comments: - items: - $ref: '#/definitions/handlers.MapDiscussionComment' - type: array - creator: - $ref: '#/definitions/models.UserShortWithAvatar' - id: - type: integer - title: - type: string - updated_at: - description: Upvotes int `json:"upvotes"` - type: string - type: object handlers.MapDiscussionResponse: properties: discussion: @@ -174,7 +158,7 @@ definitions: properties: discussions: items: - $ref: '#/definitions/handlers.MapDiscussionOnlyTitle' + $ref: '#/definitions/handlers.MapDiscussion' type: array type: object handlers.MapLeaderboardsResponse: @@ -792,6 +776,11 @@ paths: name: mapid required: true type: integer + - description: Discussion ID + in: path + name: discussionid + required: true + type: integer - description: Body in: body name: request -- cgit v1.2.3