我想通过我的 API 从我的数据库请求一个表。但是,我不知道该表将有多少列,也不知道它将包含什么。我如何在 Swagger 中指定这一点?这就是我想做的:
paths:
/reports/{id}:
get:
summary: Detailed results
description: filler
parameters:
- name: id
in: path
description: filler
required: true
type: integer
format: int64
responses:
200:
description: OK
schema:
type: array
items:
$ref: '#/definitions/DynamicObject'
definitions:
DynamicObject:
type: object
properties:
**$IDONTKNOWWHATTODO**
关于如何定义没有特定参数的 JSON 对象有什么想法吗?
要描述任意 JSON,请使用"type": "object"
。以下是 JSON 格式的示例:
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "object"
}
}
},
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)