1
我試圖定義使用招搖後端點,但不允許requestBody
參數:招搖:requestBody不允許
/names/{roster}:
get:
#...
post:
x-swagger-router-controller: names
description: Adds or removes name(s)
operationId: manageNames
parameters:
- name: roster
in: path
description: the roster to use
type: string
required: true
requestBody:
content:
'application/json':
schema:
$ref: '#/definitions/ManageNamesRequest'
當我運行npm start
,我得到這個:
API Errors:
#/paths/~1names~1{roster}/post: Additional properties not allowed: requestBody
1 error and 0 warnings
我的規格有什麼問題?
'requestBody'是OpenAPI的3.0語法。你的工具是否支持OpenAPI 3.0? – Helen
我正在使用swagger版本2.0。我不確定? – ewok