Skip to content

Commit

Permalink
[GITEA] Document correct status code for creating Tag
Browse files Browse the repository at this point in the history
- 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 go-gitea#2200

(cherry picked from commit a2939116f5ce21295981a3a9aa84a73fe289b8b2)
(cherry picked from commit 22cff4158564a3e69bef83c458cf1f129e1b688b)
(cherry picked from commit b23a7f27bb10e782e70530cc8c37f5d11f7a684a)
  • Loading branch information
Gusted authored and earl-warren committed Feb 5, 2024
1 parent 6968862 commit 938a450
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion routers/api/v1/repo/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func CreateTag(ctx *context.APIContext) {
// schema:
// "$ref": "#/definitions/CreateTagOption"
// responses:
// "200":
// "201":
// "$ref": "#/responses/Tag"
// "404":
// "$ref": "#/responses/notFound"
Expand Down
2 changes: 1 addition & 1 deletion templates/swagger/v1_json.tmpl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 938a450

Please sign in to comment.