我正在使用Swagger记录 REST Web API 。我已经下载了 petstore 示例。它由resources.json
which 引用pet.json
和组成user.json
:
{
"apiVersion":"0.2",
"swaggerVersion":"1.0",
"basePath":"http://petstore.swagger.wordnik.com/api",
"apis":
[
{
"path":"/pet.{format}",
"description":"Operations about pets"
},
{
"path":"/user.{format}",
"description":"Operations about user"
}
]
}
但即使在将原始文件上传到我的网络服务器之后,Swagger UI 也会告诉我:
Unable to fetch API Listing. Tried the following urls:
http://www.myserver.org/resources.json
http://www.myserver.org
http://www.myserver.org/resources.json
http://www.myserver.org/resources
你能说出是什么原因导致 Swagger 找不到我的 json 文件吗?