From 96d39155f25f0c39c43fec6a70069524b442d453 Mon Sep 17 00:00:00 2001 From: mkljczk Date: Tue, 25 Feb 2025 12:47:48 +0100 Subject: [PATCH] [docs] Fix swagger operation descriptions (#3830) * Fix swagger operation descriptions Signed-off-by: mkljczk * generate a swagger file Signed-off-by: mkljczk --------- Signed-off-by: mkljczk --- docs/api/swagger.yaml | 120 +++++++++++++------------- internal/api/client/admin/ruleget.go | 2 +- internal/api/client/admin/rulesget.go | 2 +- 3 files changed, 61 insertions(+), 63 deletions(-) diff --git a/docs/api/swagger.yaml b/docs/api/swagger.yaml index 836df83e8..2e250060a 100644 --- a/docs/api/swagger.yaml +++ b/docs/api/swagger.yaml @@ -6990,6 +6990,34 @@ paths: tags: - admin /api/v1/admin/instance/rules: + get: + description: The rules will be returned in order (sorted by Order ascending). + operationId: adminsRuleGet + produces: + - application/json + responses: + "200": + description: An array with all the rules for the local instance. + schema: + items: + $ref: '#/definitions/instanceRule' + type: array + "400": + description: bad request + "401": + description: unauthorized + "404": + description: not found + "406": + description: not acceptable + "500": + description: internal server error + security: + - OAuth2 Bearer: + - admin + summary: View instance rules, with IDs. + tags: + - admin post: consumes: - multipart/form-data @@ -7062,6 +7090,37 @@ paths: summary: Delete an existing instance rule. tags: - admin + get: + operationId: adminRuleGet + parameters: + - description: The id of the rule. + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: The requested rule. + schema: + $ref: '#/definitions/instanceRule' + "400": + description: bad request + "401": + description: unauthorized + "404": + description: not found + "406": + description: not acceptable + "500": + description: internal server error + security: + - OAuth2 Bearer: + - admin + summary: View instance rule with the given id. + tags: + - admin patch: consumes: - multipart/form-data @@ -7326,67 +7385,6 @@ paths: summary: Mark a report as resolved. tags: - admin - /api/v1/admin/rules: - get: - description: The rules will be returned in order (sorted by Order ascending). - operationId: adminsRuleGet - produces: - - application/json - responses: - "200": - description: An array with all the rules for the local instance. - schema: - items: - $ref: '#/definitions/instanceRule' - type: array - "400": - description: bad request - "401": - description: unauthorized - "404": - description: not found - "406": - description: not acceptable - "500": - description: internal server error - security: - - OAuth2 Bearer: - - admin - summary: View instance rules, with IDs. - tags: - - admin - /api/v1/admin/rules/{id}: - get: - operationId: adminRuleGet - parameters: - - description: The id of the rule. - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: The requested rule. - schema: - $ref: '#/definitions/instanceRule' - "400": - description: bad request - "401": - description: unauthorized - "404": - description: not found - "406": - description: not acceptable - "500": - description: internal server error - security: - - OAuth2 Bearer: - - admin - summary: View instance rule with the given id. - tags: - - admin /api/v1/announcements: get: description: 'THIS ENDPOINT IS CURRENTLY NOT FULLY IMPLEMENTED: it will always return an empty array.' diff --git a/internal/api/client/admin/ruleget.go b/internal/api/client/admin/ruleget.go index 28c0599f5..da76232eb 100644 --- a/internal/api/client/admin/ruleget.go +++ b/internal/api/client/admin/ruleget.go @@ -27,7 +27,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/oauth" ) -// RuleGETHandler swagger:operation GET /api/v1/admin/rules/{id} adminRuleGet +// RuleGETHandler swagger:operation GET /api/v1/admin/instance/rules/{id} adminRuleGet // // View instance rule with the given id. // diff --git a/internal/api/client/admin/rulesget.go b/internal/api/client/admin/rulesget.go index e00ff1c07..b22ab1a8a 100644 --- a/internal/api/client/admin/rulesget.go +++ b/internal/api/client/admin/rulesget.go @@ -27,7 +27,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/oauth" ) -// RulesGETHandler swagger:operation GET /api/v1/admin/rules adminsRuleGet +// RulesGETHandler swagger:operation GET /api/v1/admin/instance/rules adminsRuleGet // // View instance rules, with IDs. //