在下面的招摇文档中,我得到了一个参数定义错误。
/store/{Filepath}:
put:
summary: Store file to the archive
description: ""
consumes:
- multipart/form-data
produces:
- application/json
parameters:
- in: path
name: Filepath
type: string
description: Filename
required: true
- in: body
name: body
description: File to be uploaded
required: true
type: file
responses:
"201":
description: File sucessfully stored
这会在Not a valid parameter definition
上方的行上生成- in: body
错误和点。我看不出有什么问题,你们发现可能出错的地方。
答案 0 :(得分:0)
您打算定义formData
参数吗?例如:
- in: formData
name: body
description: File to be uploaded
required: true
type: file
这应该消除错误,但我不确定它是你的意图。
如果您确实打算定义body
参数,则需要schema
属性:
- in: body
name: body
description: File to be uploaded
required: true
schema:
type: object