Skip to content

Commit

Permalink
add simple descriptions for file API responses (go-gitea#4089)
Browse files Browse the repository at this point in the history
* Partial fix for go-gitea#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>
  • Loading branch information
stevegt authored and lunny committed Jun 1, 2018
1 parent 7707ad7 commit 39f2aa7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
12 changes: 9 additions & 3 deletions public/swagger.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,9 @@
}
],
"responses": {
"200": {}
"200": {
"description": "success"
}
}
}
},
Expand Down Expand Up @@ -1338,7 +1340,9 @@
}
],
"responses": {
"200": {}
"200": {
"description": "success"
}
}
}
},
Expand Down Expand Up @@ -3261,7 +3265,9 @@
}
],
"responses": {
"200": {}
"200": {
"description": "success"
}
}
}
},
Expand Down
9 changes: 6 additions & 3 deletions routers/api/v1/repo/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func GetRawFile(ctx *context.APIContext) {
// type: string
// required: true
// responses:
// 200:
// 200:
// description: success
if !ctx.Repo.HasAccess() {
ctx.Status(404)
return
Expand Down Expand Up @@ -85,7 +86,8 @@ func GetArchive(ctx *context.APIContext) {
// type: string
// required: true
// responses:
// 200:
// 200:
// description: success
repoPath := models.RepoPath(ctx.Params(":username"), ctx.Params(":reponame"))
gitRepo, err := git.OpenRepository(repoPath)
if err != nil {
Expand Down Expand Up @@ -121,7 +123,8 @@ func GetEditorconfig(ctx *context.APIContext) {
// type: string
// required: true
// responses:
// 200:
// 200:
// description: success
ec, err := ctx.Repo.GetEditorconfig()
if err != nil {
if git.IsErrNotExist(err) {
Expand Down

0 comments on commit 39f2aa7

Please sign in to comment.