我正在使用 Swagger 编辑器编写 API 文档,但在包含 JSON 对象的多部分 POST 请求中遇到问题。这是我的 Swagger YAML 文件:
swagger: '2.0'
info:
version: 1.0.0
title: Documentation API
paths:
/agent:
post:
consumes:
- multipart/form-data
produces:
- text/html
parameters:
- in: query
name: method
description: name of method to access
required: true
type: string
- in: body
name: param
description: parameter to send
required: true
schema:
$ref: "#/definitions/Param"
responses:
201:
description: item created
400:
description: invalid input, object invalid
409:
description: an existing item already exists
definitions:
Param: # …Run Code Online (Sandbox Code Playgroud)