From 85fb63f46f7155f02ed2630f2301c0a1e59c6c59 Mon Sep 17 00:00:00 2001 From: Leonid Shevtsov Date: Sun, 30 Mar 2025 11:21:08 +0300 Subject: [PATCH] [docs] Fix Swagger URL for the "edit status" operation (#3932) --- docs/api/swagger.yaml | 145 +++++++++++---------- internal/api/client/statuses/statusedit.go | 8 +- 2 files changed, 82 insertions(+), 71 deletions(-) diff --git a/docs/api/swagger.yaml b/docs/api/swagger.yaml index 1a96b0f65..e1c1c14e9 100644 --- a/docs/api/swagger.yaml +++ b/docs/api/swagger.yaml @@ -10732,6 +10732,76 @@ paths: summary: Create a new status using the given form field parameters. tags: - statuses + /api/v1/statuses/{id}: + delete: + description: |- + The deleted status will be returned in the response. The `text` field will contain the original text of the status as it was submitted. + This is useful when doing a 'delete and redraft' type operation. + operationId: statusDelete + parameters: + - description: Target status ID. + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: The status that was just deleted. + schema: + $ref: '#/definitions/status' + "400": + description: bad request + "401": + description: unauthorized + "403": + description: forbidden + "404": + description: not found + "406": + description: not acceptable + "500": + description: internal server error + security: + - OAuth2 Bearer: + - write:statuses + summary: Delete status with the given ID. The status must belong to you. + tags: + - statuses + get: + operationId: statusGet + parameters: + - description: Target status ID. + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: The requested status. + schema: + $ref: '#/definitions/status' + "400": + description: bad request + "401": + description: unauthorized + "403": + description: forbidden + "404": + description: not found + "406": + description: not acceptable + "500": + description: internal server error + security: + - OAuth2 Bearer: + - read:statuses + summary: View status with the given ID. + tags: + - statuses put: consumes: - application/json @@ -10739,6 +10809,11 @@ paths: description: The parameters can also be given in the body of the request, as JSON, if the content-type is set to 'application/json'. operationId: statusEdit parameters: + - description: Target status ID. + in: path + name: id + required: true + type: string - description: |- Text content of the status. If media_ids is provided, this becomes optional. @@ -10838,76 +10913,6 @@ paths: summary: Edit an existing status using the given form field parameters. tags: - statuses - /api/v1/statuses/{id}: - delete: - description: |- - The deleted status will be returned in the response. The `text` field will contain the original text of the status as it was submitted. - This is useful when doing a 'delete and redraft' type operation. - operationId: statusDelete - parameters: - - description: Target status ID. - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: The status that was just deleted. - schema: - $ref: '#/definitions/status' - "400": - description: bad request - "401": - description: unauthorized - "403": - description: forbidden - "404": - description: not found - "406": - description: not acceptable - "500": - description: internal server error - security: - - OAuth2 Bearer: - - write:statuses - summary: Delete status with the given ID. The status must belong to you. - tags: - - statuses - get: - operationId: statusGet - parameters: - - description: Target status ID. - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: The requested status. - schema: - $ref: '#/definitions/status' - "400": - description: bad request - "401": - description: unauthorized - "403": - description: forbidden - "404": - description: not found - "406": - description: not acceptable - "500": - description: internal server error - security: - - OAuth2 Bearer: - - read:statuses - summary: View status with the given ID. - tags: - - statuses /api/v1/statuses/{id}/bookmark: post: operationId: statusBookmark diff --git a/internal/api/client/statuses/statusedit.go b/internal/api/client/statuses/statusedit.go index dbd2224f7..5c58c5098 100644 --- a/internal/api/client/statuses/statusedit.go +++ b/internal/api/client/statuses/statusedit.go @@ -30,7 +30,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/util" ) -// StatusEditPUTHandler swagger:operation PUT /api/v1/statuses statusEdit +// StatusEditPUTHandler swagger:operation PUT /api/v1/statuses/{id} statusEdit // // Edit an existing status using the given form field parameters. // @@ -46,6 +46,12 @@ import ( // // parameters: // - +// name: id +// type: string +// description: Target status ID. +// in: path +// required: true +// - // name: status // x-go-name: Status // description: |-