Swagger语言 - 如何在响应组件中定义字节[][]



如果我描述的是"public byte[] data",我这样做是:

Data:
type: string
format: base64
description: "The generated report as a single file in the user specified format. If this is populated Pages will be null."

但是我如何描述像"公共字节[][]页面"这样的二维数组呢?

通常多维数组用于请求组件,但对于响应组件,数组将被扁平化为单个字节数组。

无论如何,您可以使用以下代码实现:

Data:
type: array
items:
type: string
format: base64
description: "The generated report as a single file in the user specified format."

最新更新