mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
[API] GetCombinedCommitStatusByRef always return json & swagger doc fixes (#14047)
* Fix swagger docs * always return json
This commit is contained in:
@@ -244,7 +244,7 @@ type combinedCommitStatus struct {
|
||||
|
||||
// GetCombinedCommitStatusByRef returns the combined status for any given commit hash
|
||||
func GetCombinedCommitStatusByRef(ctx *context.APIContext) {
|
||||
// swagger:operation GET /repos/{owner}/{repo}/commits/{ref}/statuses repository repoGetCombinedStatusByRef
|
||||
// swagger:operation GET /repos/{owner}/{repo}/commits/{ref}/status repository repoGetCombinedStatusByRef
|
||||
// ---
|
||||
// summary: Get a commit's combined status, by branch/tag/commit reference
|
||||
// produces:
|
||||
@@ -272,7 +272,7 @@ func GetCombinedCommitStatusByRef(ctx *context.APIContext) {
|
||||
// required: false
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/Status"
|
||||
// "$ref": "#/responses/CombinedStatus"
|
||||
// "400":
|
||||
// "$ref": "#/responses/error"
|
||||
|
||||
@@ -292,7 +292,7 @@ func GetCombinedCommitStatusByRef(ctx *context.APIContext) {
|
||||
}
|
||||
|
||||
if len(statuses) == 0 {
|
||||
ctx.Status(http.StatusOK)
|
||||
ctx.JSON(http.StatusOK, &api.CombinedStatus{})
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -309,3 +309,10 @@ type swaggerLanguageStatistics struct {
|
||||
// in: body
|
||||
Body map[string]int64 `json:"body"`
|
||||
}
|
||||
|
||||
// CombinedStatus
|
||||
// swagger:response CombinedStatus
|
||||
type swaggerCombinedStatus struct {
|
||||
// in: body
|
||||
Body api.CombinedStatus `json:"body"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user