From 938a450c9ebc6435650e83e7b395d4448e082c7d Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 21 Jan 2024 23:53:43 +0100 Subject: [PATCH] [GITEA] Document correct status code for creating Tag - When there's a succesful POST operation, it should return a 201 status code (which is the status code for succesful created) and additionally the created object. - Currently for the `POST /repos/{owner}/{repo}/tags` endpoint an 200 status code was documented in the OpenAPI specification, while an 201 status code was actually being returned. In this case the code is correct and the documented status code needs to be adjusted. - Resolves #2200 (cherry picked from commit a2939116f5ce21295981a3a9aa84a73fe289b8b2) (cherry picked from commit 22cff4158564a3e69bef83c458cf1f129e1b688b) (cherry picked from commit b23a7f27bb10e782e70530cc8c37f5d11f7a684a) --- routers/api/v1/repo/tag.go | 2 +- templates/swagger/v1_json.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/api/v1/repo/tag.go b/routers/api/v1/repo/tag.go index 2f19f95e66..ad812ace56 100644 --- a/routers/api/v1/repo/tag.go +++ b/routers/api/v1/repo/tag.go @@ -176,7 +176,7 @@ func CreateTag(ctx *context.APIContext) { // schema: // "$ref": "#/definitions/CreateTagOption" // responses: - // "200": + // "201": // "$ref": "#/responses/Tag" // "404": // "$ref": "#/responses/notFound" diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index e4fd81d78a..0d1ac4ba48 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -13349,7 +13349,7 @@ } ], "responses": { - "200": { + "201": { "$ref": "#/responses/Tag" }, "404": {