我的https://x.y/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://x.y: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"}
任何想法都会被理解为解开这个谜团:
答案 0 :(得分:0)
这是一个葡萄招摇的错误:
葡萄招摇(<0.7>):path => "#{url_base}/#{local_route}#{url_format}",
葡萄酒中的葡萄酒(0.8.0)
path: "/#{local_route}#{url_format}",