0
我想爲休息api定義一個簡單的swagger定義。我的所有參數部分都出現錯誤。Swagger錯誤 - 描述:「不是一個有效的參數定義」
我在swagger編輯器中遇到了swagger定義錯誤,我沒有得到任何線索,我錯了。請指教。
揚鞭定義:
paths:
'/customer/{customerId}/accountlist':
get:
responses:
'200':
description: ''
parameters:
- name: customerId
in: path
allowMultiple: false
required: true
type: string
x-auth-type: None
x-throttling-tier: Unlimited
produces:
- application/json
x-scope: InternalUse
swagger: '2.0'
info:
title: Sample
description: API for Sample
揚鞭錯誤:
Swagger Error
Not a valid parameter definition
Jump to line 7
Details
Object
code: "ONE_OF_MISSING"
params: Array [0]
message: "Not a valid parameter definition"
path: Array [5]
0: "paths"
1: "/customer/{customerId}/accountlist"
2: "get"
3: "parameters"
4: "0"
schemaId: "http://swagger.io/v2/schema.json#"
inner: Array [2]
0: Object
code: "ONE_OF_MISSING"
params: Array [0]
message: "Data does not match any schemas from 'oneOf'"
path: Array [5]
0: "paths"
1: "/customer/{customerId}/accountlist"
2: "get"
3: "parameters"
4: "0"
inner: Array [2]
0: Object
code: "OBJECT_MISSING_REQUIRED_PROPERTY"
params: Array [1]
0: "schema"
message: "Missing required property: schema"
path: Array [0]
1: Object
code: "ONE_OF_MISSING"
params: Array [0]
message: "Data does not match any schemas from 'oneOf'"
path: Array [0]
inner: Array [4]
1: Object
code: "OBJECT_MISSING_REQUIRED_PROPERTY"
params: Array [1]
0: "$ref"
message: "Missing required property: $ref"
path: Array [5]
0: "paths"
1: "/customer/{customerId}/accountlist"
2: "get"
3: "parameters"
4: "0"
level: 900
type: "Swagger Error"
description: "Not a valid parameter definition"
lineNumber: 7
請在您的問題中最好以YAML格式包含Swagger/OpenAPI定義。 –
添加示例swagger定義作爲問題的一部分。 – Pravin