【发布时间】:2017-01-22 12:15:55
【问题描述】:
我正在尝试使用 Azure API 管理服务。
当我转到 Import API 时,我目前收到以下错误。
One or more fields contain incorrect values:
Parsing error(s): Unexpected character encountered while parsing value: #. Path '', line 0, position 0.
One or more fields contain incorrect values:
API not found
当我上传我的招摇规范时会发生这种情况。这是我第一次写它,但我浏览了我的文档,似乎找不到任何问题。
我也在其他地方使用过这个文档,效果很好。
http://pastebin.com/fb4xiuLu我的招摇文档的链接
任何帮助将不胜感激。谢谢:)
【问题讨论】:
-
尝试以 json 格式上传您的 swagger 文档。
-
顺便说一句,您的规范不是有效的 Swagger 规范。 1)
type: ['integer','null']等多种类型为not supported;type需要单一类型。 2)null不是有效类型,因为它不是 listed in the spec。但是有一个 discussion in the OpenAPI spec repo 在下一版本的规范 3.0 中添加“空值”支持。