我的招摇文件面临问题:
swagger: '2.0'
paths:
/currencies:
get:
responses:
'200':
description: ''
summary: 'list currencies summary'
x-auth-type: None
x-throttling-tier: Unlimited
produces:
- application/json
description: 'list currencies description'
'/currencies/{currencieId}':
get:
responses:
'200':
description: ''
description: 'Single currency description'
parameters:
- name: currencieId
in: path
allowMultiple: false
required: true
type: string
description: 'paramter description'
summary: 'Single currency'
x-auth-type: None
x-throttling-tier: Unlimited
produces:
- application/json
info:
title: MDM
version: v1
这是我的问题:
✖Swagger错误 不是有效的参数定义 跳到第20行 细节 宾语 代码:“ONE_OF_MISSING” 参数:数组[0] 消息:“不是有效的参数定义” 路径:数组[5] 0:“路径” 1:“/ currency / {currencieId}” 2:“得到” 3:“参数” 4:“0” schemaId:“http://swagger.io/v2/schema.json#” 内部:数组[2] 等级:900 类型:“Swagger错误” description:“不是有效的参数定义” lineNumber:20
我有点失落......
感谢您的帮助。
于连
答案 0 :(得分:2)
从allowMultiple: false
参数的定义中删除currencieId
。这消除了错误。
OpenAPI (fka Swagger) Specification 2.0中不存在allowMultiple
关键字。它在v1.2中使用,但在2.0中,它已替换为type: array
和collectionFormat
。
答案 1 :(得分:0)
allowMultiple:false不正确