【发布时间】:2019-07-10 02:54:43
【问题描述】:
我收到以下错误:
声明的路径参数“imageId”需要定义为路径 路径或操作级别的参数
这是我的招摇定义的快照
'/api/v1/images/{unitnumber}/{type}/{imageId}':
delete:
tags:
- Images
summary: 'Summary'
description: "Description"
operationId: DeleteImage
consumes: []
produces:
- application/json
parameters:
- name: unitnumber
in: path
required: true
type: string
- name: type
in: path
required: true
type: string
- name: imageId
in: query
required: false
type: string
responses:
'400':
description: Bad Request
schema:
$ref: '#/definitions/ErrorResponse'
'401':
description: Unauthorized
schema:
type: string
'500':
description: Server Error
schema:
$ref: '#/definitions/ErrorResponse'
如果我使用imageId 并改为path 而不是query,我只能摆脱错误,这不是本意
- name: imageId
in: path
required: true
type: string
知道我需要改变什么才能使它正常工作吗?
【问题讨论】:
标签: swagger openapi swagger-editor