mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 12:15:43 +01:00
Add return type to GetRawFileOrLFS and GetRawFile (#31680)
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 <teabot@gitea.io> (cherry picked from commit bae87dfb0958e6a2920c905e51c2a026b7b71ca6)
This commit is contained in:
parent
d0e52fd641
commit
94e9cbcd71
2 changed files with 19 additions and 4 deletions
|
@ -45,7 +45,7 @@ func GetRawFile(ctx *context.APIContext) {
|
||||||
// ---
|
// ---
|
||||||
// summary: Get a file from a repository
|
// summary: Get a file from a repository
|
||||||
// produces:
|
// produces:
|
||||||
// - application/json
|
// - application/octet-stream
|
||||||
// parameters:
|
// parameters:
|
||||||
// - name: owner
|
// - name: owner
|
||||||
// in: path
|
// in: path
|
||||||
|
@ -70,6 +70,8 @@ func GetRawFile(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// 200:
|
// 200:
|
||||||
// description: Returns raw file content.
|
// description: Returns raw file content.
|
||||||
|
// schema:
|
||||||
|
// type: file
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
@ -96,6 +98,8 @@ func GetRawFileOrLFS(ctx *context.APIContext) {
|
||||||
// swagger:operation GET /repos/{owner}/{repo}/media/{filepath} repository repoGetRawFileOrLFS
|
// swagger:operation GET /repos/{owner}/{repo}/media/{filepath} repository repoGetRawFileOrLFS
|
||||||
// ---
|
// ---
|
||||||
// summary: Get a file or it's LFS object from a repository
|
// summary: Get a file or it's LFS object from a repository
|
||||||
|
// produces:
|
||||||
|
// - application/octet-stream
|
||||||
// parameters:
|
// parameters:
|
||||||
// - name: owner
|
// - name: owner
|
||||||
// in: path
|
// in: path
|
||||||
|
@ -120,6 +124,8 @@ func GetRawFileOrLFS(ctx *context.APIContext) {
|
||||||
// responses:
|
// responses:
|
||||||
// 200:
|
// 200:
|
||||||
// description: Returns raw file content.
|
// description: Returns raw file content.
|
||||||
|
// schema:
|
||||||
|
// type: file
|
||||||
// "404":
|
// "404":
|
||||||
// "$ref": "#/responses/notFound"
|
// "$ref": "#/responses/notFound"
|
||||||
|
|
||||||
|
|
15
templates/swagger/v1_json.tmpl
generated
15
templates/swagger/v1_json.tmpl
generated
|
@ -10867,6 +10867,9 @@
|
||||||
},
|
},
|
||||||
"/repos/{owner}/{repo}/media/{filepath}": {
|
"/repos/{owner}/{repo}/media/{filepath}": {
|
||||||
"get": {
|
"get": {
|
||||||
|
"produces": [
|
||||||
|
"application/octet-stream"
|
||||||
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"repository"
|
"repository"
|
||||||
],
|
],
|
||||||
|
@ -10903,7 +10906,10 @@
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "Returns raw file content."
|
"description": "Returns raw file content.",
|
||||||
|
"schema": {
|
||||||
|
"type": "file"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
|
@ -13122,7 +13128,7 @@
|
||||||
"/repos/{owner}/{repo}/raw/{filepath}": {
|
"/repos/{owner}/{repo}/raw/{filepath}": {
|
||||||
"get": {
|
"get": {
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/octet-stream"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"repository"
|
"repository"
|
||||||
|
@ -13160,7 +13166,10 @@
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "Returns raw file content."
|
"description": "Returns raw file content.",
|
||||||
|
"schema": {
|
||||||
|
"type": "file"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"$ref": "#/responses/notFound"
|
"$ref": "#/responses/notFound"
|
||||||
|
|
Loading…
Reference in a new issue