{ "openapi": "3.0.0", "info": { "title": "文件下载 API", "version": "1.0.0" }, "paths": { "/files/{fileId}/download": { "get": { "summary": "下载文件", "description": "根据文件ID下载对应的文件流。", "parameters": [ { "name": "fileId", "in": "path", "required": true, "description": "文件的唯一标识符", "schema": { "type": "string" } } ], "responses": { "200": { "description": "文件下载成功", "headers": { "Content-Disposition": { "schema": { "type": "string" }, "description": "指示响应内容如何处理。例如:`inline` 表示浏览器可能尝试直接显示(如图片、PDF),`attachment; filename=\"file.zip\"` 表示强制下载:cite[4]:cite[7]。" } }, "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } } }, "404": { "description": "文件未找到", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } } } } } } } } } }