From e9bee58aeb1ab4d2894d41c82ba0a3ded5ca9dcc Mon Sep 17 00:00:00 2001 From: Gara Dorta <1507774+Gara-Dorta@users.noreply.github.com> Date: Sat, 26 Sep 2026 23:20:04 +0200 Subject: [PATCH] docs: fix wrong annotations for SendV2 and 200 - 201 --- src/api/api.go | 10 +++++----- src/docs/docs.go | 17 ++++++++++------- src/docs/swagger.json | 17 ++++++++++------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/api/api.go b/src/api/api.go index 210660b..f0d637c 100644 --- a/src/api/api.go +++ b/src/api/api.go @@ -497,7 +497,7 @@ func (a *Api) Send(c *gin.Context) { // @Description Send a signal message. Set the text_mode to 'styled' in case you want to add formatting to your text message. Styling Options: \*italic text\*, \*\*bold text\*\*, ~strikethrough text~, ||spoiler||, \`monospace\`. If you want to escape a formatting character, prefix it with two backslashes. // @Accept json // @Produce json -// @Success 201 {object} ds.SendMessageResponse +// @Success 201 {array} ds.SendMessageResponse // @Failure 400 {object} SendMessageError // @Param data body SendMessageV2 true "Input Data" // @Router /v2/send [post] @@ -1202,7 +1202,7 @@ func (a *Api) DeleteGroup(c *gin.Context) { // @Description Pin a message in a Signal Group. // @Accept json // @Produce json -// @Success 200 {string} string "OK" +// @Success 201 {string} string "OK" // @Failure 400 {object} Error // @Param data body PinMessageInGroupRequest true "Pin" // @Param number path string true "Registered Phone Number" @@ -1253,7 +1253,7 @@ func (a *Api) PinMessageInGroup(c *gin.Context) { // @Description Unpin a message in a Signal Group. // @Accept json // @Produce json -// @Success 200 {string} string "OK" +// @Success 201 {string} string "OK" // @Failure 400 {object} Error // @Param data body UnpinMessageInGroupRequest true "Unpin" // @Param number path string true "Registered Phone Number" @@ -2426,7 +2426,7 @@ func (a *Api) SubmitRateLimitChallenge(c *gin.Context) { // @Produce json // @Param number path string true "Registered Phone Number" // @Param data body UpdateAccountSettingsRequest true "Request" -// @Success 204 +// @Success 201 // @Failure 400 {object} Error // @Router /v1/accounts/{number}/settings [put] func (a *Api) UpdateAccountSettings(c *gin.Context) { @@ -2557,7 +2557,7 @@ func (a *Api) ListInstalledStickerPacks(c *gin.Context) { // @Accept json // @Produce json // @Param number path string true "Registered Phone Number" -// @Success 204 +// @Success 201 // @Failure 400 {object} Error // @Param data body AddStickerPackRequest true "Request" // @Router /v1/sticker-packs/{number} [post] diff --git a/src/docs/docs.go b/src/docs/docs.go index cda355d..be10280 100644 --- a/src/docs/docs.go +++ b/src/docs/docs.go @@ -2628,8 +2628,8 @@ const docTemplate = `{ "application/json" ], "responses": { - "204": { - "description": "No Content" + "201": { + "description": "Created" }, "400": { "description": "Bad Request", @@ -3938,7 +3938,7 @@ const docTemplate = `{ "application/json" ], "responses": { - "200": { + "201": { "description": "OK", "schema": { "type": "string" @@ -3990,7 +3990,7 @@ const docTemplate = `{ "application/json" ], "responses": { - "200": { + "201": { "description": "OK", "schema": { "type": "string" @@ -4929,8 +4929,8 @@ const docTemplate = `{ "application/json" ], "responses": { - "204": { - "description": "No Content" + "201": { + "description": "Created" }, "400": { "description": "Bad Request", @@ -5104,7 +5104,10 @@ const docTemplate = `{ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/data.SendMessageResponse" + "items": { + "$ref": "#/definitions/data.SendMessageResponse" + }, + "type": "array" } }, "400": { diff --git a/src/docs/swagger.json b/src/docs/swagger.json index 27a3542..2b5494d 100644 --- a/src/docs/swagger.json +++ b/src/docs/swagger.json @@ -2623,8 +2623,8 @@ "application/json" ], "responses": { - "204": { - "description": "No Content" + "201": { + "description": "Created" }, "400": { "description": "Bad Request", @@ -3933,7 +3933,7 @@ "application/json" ], "responses": { - "200": { + "201": { "description": "OK", "schema": { "type": "string" @@ -3985,7 +3985,7 @@ "application/json" ], "responses": { - "200": { + "201": { "description": "OK", "schema": { "type": "string" @@ -4924,8 +4924,8 @@ "application/json" ], "responses": { - "204": { - "description": "No Content" + "201": { + "description": "Created" }, "400": { "description": "Bad Request", @@ -5099,7 +5099,10 @@ "201": { "description": "Created", "schema": { - "$ref": "#/definitions/data.SendMessageResponse" + "items": { + "$ref": "#/definitions/data.SendMessageResponse" + }, + "type": "array" } }, "400": {