我的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"}
任何想法将不胜感激,以解决这个谜: