Swagger-如何在响应组件中定义byte [] []

时间:2020-05-17 15:50:00

标签: swagger openapi

如果我要描述“公共字节[]数据”,我这样做是:

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."

但是如何描述二维数组,例如“ public byte [] [] Pages”?

1 个答案:

答案 0 :(得分:0)

通常,多维数组用于Request组件,但对于Response组件,该数组将被扁平化为单个字节数组。

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

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