mirror of
https://github.com/go-gitea/gitea
synced 2024-12-23 00:54:28 +00:00
Fix lint-swagger warning (#29787)
Caused by: #23106 Fix: https://github.com/go-gitea/gitea/actions/runs/8274650046/job/22640335697 1. Delete `UserBadgeList` in `options.go`, because it wasn't used. (The struct defined in `options.go` is the struct used to parse the request body) 2. Move `BadgeList` struct under `routers/api/v1/swagger` folder which response should be defined in.
This commit is contained in:
parent
eb8c34fc36
commit
2033eb7c11
@ -132,10 +132,3 @@ type UserBadgeOption struct {
|
|||||||
// example: ["badge1","badge2"]
|
// example: ["badge1","badge2"]
|
||||||
BadgeSlugs []string `json:"badge_slugs" binding:"Required"`
|
BadgeSlugs []string `json:"badge_slugs" binding:"Required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// BadgeList
|
|
||||||
// swagger:response BadgeList
|
|
||||||
type BadgeList struct {
|
|
||||||
// in:body
|
|
||||||
Body []Badge `json:"body"`
|
|
||||||
}
|
|
||||||
|
@ -193,7 +193,4 @@ type swaggerParameterBodies struct {
|
|||||||
|
|
||||||
// in:body
|
// in:body
|
||||||
UserBadgeOption api.UserBadgeOption
|
UserBadgeOption api.UserBadgeOption
|
||||||
|
|
||||||
// in:body
|
|
||||||
UserBadgeList api.BadgeList
|
|
||||||
}
|
}
|
||||||
|
@ -48,3 +48,10 @@ type swaggerResponseUserSettings struct {
|
|||||||
// in:body
|
// in:body
|
||||||
Body []api.UserSettings `json:"body"`
|
Body []api.UserSettings `json:"body"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BadgeList
|
||||||
|
// swagger:response BadgeList
|
||||||
|
type swaggerResponseBadgeList struct {
|
||||||
|
// in:body
|
||||||
|
Body []api.Badge `json:"body"`
|
||||||
|
}
|
||||||
|
17
templates/swagger/v1_json.tmpl
generated
17
templates/swagger/v1_json.tmpl
generated
@ -17413,21 +17413,6 @@
|
|||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
},
|
},
|
||||||
"BadgeList": {
|
|
||||||
"description": "BadgeList",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"body": {
|
|
||||||
"description": "in:body",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/Badge"
|
|
||||||
},
|
|
||||||
"x-go-name": "Body"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
|
||||||
},
|
|
||||||
"Branch": {
|
"Branch": {
|
||||||
"description": "Branch represents a repository branch",
|
"description": "Branch represents a repository branch",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@ -24722,7 +24707,7 @@
|
|||||||
"parameterBodies": {
|
"parameterBodies": {
|
||||||
"description": "parameterBodies",
|
"description": "parameterBodies",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/BadgeList"
|
"$ref": "#/definitions/UserBadgeOption"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"redirect": {
|
"redirect": {
|
||||||
|
Loading…
Reference in New Issue
Block a user