我正在使用 Swagger 记录 REST Web API。我已经下载了 petstore 的示例。它包含了 resources.json
,其中引用了 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"
}
]
}
但是即使我已经将原始文件上传到我的Web服务器上,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文件的原因吗?