我怎么能看到我服务的招摇文件?

问题描述 投票:0回答:1

我正在使用Swagger版本2.当我请求时,我得到以下结果:

 http://localhost:8080/SwaggerProject/jaxrs/MyService/V1/swagger.json

"swagger": "2.0",
"info": {
"description": "The Application",
"version": "1.0.0",
"title": "Sample REST Application",
"contact": {
  "name": "[email protected]"
},
"license": {
  "name": "Apache 2.0 License",
  "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
  "basePath": "/SwaggerProject/jaxrs/MyService/V2"
  }

我的问题是如何才能看到我的服务(MyService)的昂首文档?任何帮助都很感激。

java rest web swagger cxf
1个回答
0
投票

使用该链接,您可以请求swagger json配置。我假设您使用swagger来记录某种Rest Web服务。

为了定义swagger,您需要编辑web xml或覆盖Application Config,就像现在一样。因此,为了以更加用户友好的方式查看完整的文档和采样以及服务演示,您可以定义上面提到的swagger url和一般配置。

我之前使用过swagger但我现在无法回想起/找到默认配置。但是,一个非常好的示例配置Swagger with Spring可以找到here

如果您使用c#here,另一个有用的链接

你也可以检查一下this

使用java作为lang here的Application配置示例。我希望这有帮助。最后我对默认索引设置的猜测就像http://ip:port/YourServiceName/namespace_if_using_one/swagger/index.html

© www.soinside.com 2019 - 2024. All rights reserved.