swagger - Swagger - 如何在响应组件中定义 byte[][]
问题描述
如果我描述的是“公共字节 [] 数据”,我会这样做:
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”这样的二维数组呢?
解决方案
通常多维数组用于请求组件,但对于响应组件,该数组将被展平为单个字节数组。
无论如何,您可以使用以下代码实现:
Data:
type: array
items:
type: string
format: base64
description: "The generated report as a single file in the user specified format."
推荐阅读
- python - Python:多重继承后是否可以合并两个__init__?
- apache-kafka - 如何使用 WSO2ESB 中的标头将值从发布者传递给订阅者
- php - 如何在不使用 php 缩放图像的情况下增加图像大小
- java - 如何使用 Spring 存储库在 LDAP 中绑定多值属性
- r - 带有复选框和分页的闪亮数据表
- kubernetes - 将 MLFlow 与 Kubeflow 集成
- ubuntu - 不允许从 GCP 服务器上运行的 Jupyter 笔记本下载
- android - 如何检查用户是否存在于android中的SQL数据库中
- go - 错误:目录中的代码......需要导入“......” - 我该怎么办?
- angular - 未捕获(承诺中):ReferenceError:未定义全局