diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go index 42483291fc..e335c29c70 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -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 @@ -67,6 +67,8 @@ func GetRawFile(ctx *context.APIContext) { // responses: // 200: // description: Returns raw file content. + // schema: + // type: file // "404": // "$ref": "#/responses/notFound" @@ -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 @@ -116,6 +120,8 @@ func GetRawFileOrLFS(ctx *context.APIContext) { // responses: // 200: // description: Returns raw file content. + // schema: + // type: file // "404": // "$ref": "#/responses/notFound" diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 3fc2698ff2..e7c6761606 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -10609,6 +10609,9 @@ }, "/repos/{owner}/{repo}/media/{filepath}": { "get": { + "produces": [ + "application/octet-stream" + ], "tags": [ "repository" ], @@ -10645,7 +10648,10 @@ ], "responses": { "200": { - "description": "Returns raw file content." + "description": "Returns raw file content.", + "schema": { + "type": "file" + } }, "404": { "$ref": "#/responses/notFound" @@ -12682,7 +12688,7 @@ "/repos/{owner}/{repo}/raw/{filepath}": { "get": { "produces": [ - "application/json" + "application/octet-stream" ], "tags": [ "repository" @@ -12720,7 +12726,10 @@ ], "responses": { "200": { - "description": "Returns raw file content." + "description": "Returns raw file content.", + "schema": { + "type": "file" + } }, "404": { "$ref": "#/responses/notFound"