我有一个端点返回图像作为响应,我希望 swagger 文档返回并在框架内显示图像。我查看了此处和此处的文档,并尝试了所有三个示例,但都没有成功。我正在尝试不可能的事情吗?
这是我的例子
paths:
"/qrcodes/{string_to_encode}":
get:
tags:
- QR Code
summary: A QR code generation endpoint
parameters:
- name: string_to_encode
in: path
required: true
description: URL encoded string to convert to a QR code
schema:
type: string
responses:
'200':
description: OK
content:
application/png:
schema:
type: string
format: binary
Run Code Online (Sandbox Code Playgroud)
生成的curl还警告二进制输出