我的Swagger REST API中有一个GET调用需要返回一个PDF文件。目前没有明确的例子/文档说明如何在不导致语法错误的情况下完成此操作。
responses:
200:
description: Returns PDF
schema: [application/pdf]
和
responses:
200:
description: Returns PDF
schema:
type: file
和
responses:
200:
description: Returns PDF
schema:
type: [application/pdf]
全部失败。这真的可能吗?
responses: '200': description: PDF 文件 content: application/pdf: schema: type: string format: binary
文档链接:https://swagger.io/docs/specification/describing-responses/ 章节:返回文件的响应 - nitashathakur