Skip to content

Commit

Permalink
Add return type to GetRawFileOrLFS and GetRawFile (#31680)
Browse files Browse the repository at this point in the history
Document return type for the endpoints that fetch specific files from a
repository. This allows the swagger generated code to read the returned
data.

Co-authored-by: Giteabot <[email protected]>
  • Loading branch information
AdamMajer and GiteaBot authored Jul 25, 2024
1 parent cc04481 commit bae87df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 7 additions & 1 deletion routers/api/v1/repo/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func GetRawFile(ctx *context.APIContext) {
// ---
// summary: Get a file from a repository
// produces:
// - application/json
// - application/octet-stream
// parameters:
// - name: owner
// in: path
Expand All @@ -67,6 +67,8 @@ func GetRawFile(ctx *context.APIContext) {
// responses:
// 200:
// description: Returns raw file content.
// schema:
// type: file
// "404":
// "$ref": "#/responses/notFound"

Expand All @@ -92,6 +94,8 @@ func GetRawFileOrLFS(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/media/{filepath} repository repoGetRawFileOrLFS
// ---
// summary: Get a file or it's LFS object from a repository
// produces:
// - application/octet-stream
// parameters:
// - name: owner
// in: path
Expand All @@ -116,6 +120,8 @@ func GetRawFileOrLFS(ctx *context.APIContext) {
// responses:
// 200:
// description: Returns raw file content.
// schema:
// type: file
// "404":
// "$ref": "#/responses/notFound"

Expand Down
15 changes: 12 additions & 3 deletions 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 bae87df

Please sign in to comment.