-2

我的https://xy/api/swagger_doc.json返回这个:

{"apiVersion":"0.1","swaggerVersion":"1.2","produces":["application/xml","application/json","application/vnd.api+json","text/plain"],"apis":[{"path":"/ping.{format}","description":"Operations about pings"},{"path":"/ping_dev.{format}"

请注意,路径指向 /ping.{format} 它应该指向 /swagger_doc/ping.json。因此,swagger ui 给了我这个错误:

Unable to read api 'friends' from path https://x.y:443/api/ping.json

我可以手动访问 ping.json 表单https://xy:443/api/swagger_doc/ping.json。内容是swagger ui所需要的:

{"apiVersion":"0.1","swaggerVersion":"1.2","resourcePath":"/ping","produces":["application/xml","application/json","application/vnd.api+json","text/plain"],"apis":[{"path":"/api/ping.{format}","operations":[{"notes":"","summary":"Returns pong.","nickname":"GET-api-ping---format-","method":"GET","parameters":[],"type":"void"}]}],"basePath":"http://local.dime.com:3000"}

任何想法将不胜感激,以解决这个谜:

4

1 回答 1

0

嗯..那是一个艰难的。

这是一个葡萄招摇的错误:

在葡萄大摇大摆(0.7.2)

:path => "#{url_base}/#{local_route}#{url_format}",

在葡萄招摇(0.8.0)

path: "/#{local_route}#{url_format}",
于 2014-09-11T08:08:39.353 回答