【发布时间】:2017-05-31 13:59:10
【问题描述】:
【问题讨论】:
-
您的一个 api 方法中有多个主体参数,这是不允许的。
标签: swagger swagger-2.0 swagger-editor
【问题讨论】:
标签: swagger swagger-2.0 swagger-editor
错误正是它所说的,“操作不能有多个主体参数”。在您的示例中,错误出现在 POST /company/fastbill/customers 操作中。
body 参数表示请求正文。因此,如果要 POST 多个数据对象,则需要将它们组合成单个对象有效负载。例如:
- name: body
in: body
required: true
schema:
type: object
properties:
customer_details:
$ref: '#/definitions/Customer'
bank_account:
type: object
properties:
sources:
type: array
items:
$ref: '#/definitions/BankAccount'
【讨论】: