mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-21 12:44:49 -05:00
add simple descriptions for file API responses (#4089)
* Partial fix for #4010 Swagger needs a description field in each swagger:operation response. Adding minimal text for now on the way to getting swagger validate to pass. Many standard swagger client libraries will not work with gitea until validate passes, so prioritizing that over better descriptions for now. Signed-off-by: Steve Traugott <stevegt@t7a.org>
This commit is contained in:
parent
7707ad7a0a
commit
39f2aa7c12
2 changed files with 15 additions and 6 deletions
12
public/swagger.v1.json
vendored
12
public/swagger.v1.json
vendored
|
@ -1028,7 +1028,9 @@
|
|||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {}
|
||||
"200": {
|
||||
"description": "success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1338,7 +1340,9 @@
|
|||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {}
|
||||
"200": {
|
||||
"description": "success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -3261,7 +3265,9 @@
|
|||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {}
|
||||
"200": {
|
||||
"description": "success"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -37,6 +37,7 @@ func GetRawFile(ctx *context.APIContext) {
|
|||
// required: true
|
||||
// responses:
|
||||
// 200:
|
||||
// description: success
|
||||
if !ctx.Repo.HasAccess() {
|
||||
ctx.Status(404)
|
||||
return
|
||||
|
@ -86,6 +87,7 @@ func GetArchive(ctx *context.APIContext) {
|
|||
// required: true
|
||||
// responses:
|
||||
// 200:
|
||||
// description: success
|
||||
repoPath := models.RepoPath(ctx.Params(":username"), ctx.Params(":reponame"))
|
||||
gitRepo, err := git.OpenRepository(repoPath)
|
||||
if err != nil {
|
||||
|
@ -122,6 +124,7 @@ func GetEditorconfig(ctx *context.APIContext) {
|
|||
// required: true
|
||||
// responses:
|
||||
// 200:
|
||||
// description: success
|
||||
ec, err := ctx.Repo.GetEditorconfig()
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
|
|
Loading…
Reference in a new issue