如何为 Spring REST 服务生成 WADL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23271597/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 06:40:50  来源:igfitidea点击:

How to generate WADL for Spring REST Service

springrestspring-mvcspring-3

提问by Utsav

Hi I am working with Spring 3.5.0.Release. I want to generate a WADL for my spring rest service. Is their any functionality in Spring by which i can easily generate the WADL.

嗨,我正在使用 Spring 3.5.0.Release。我想为我的春季休息服务生成一个 WADL。他们在 Spring 中是否有任何功能,我可以通过它轻松生成 WADL。

采纳答案by Sanjay Singh

Spring REST does not come with out of the box WADL generator like JERSEY However it should be pretty easy to get it done.

Spring REST 没有像 JERSEY 这样的开箱即用的 WADL 生成器,但是它应该很容易完成。

https://jira.spring.io/browse/SPR-8705

https://jira.spring.io/browse/SPR-8705

See Blogpost https://javattitude.wordpress.com/2014/05/26/wadl-generator-for-spring-rest/

见博客文章https://javattitude.wordpress.com/2014/05/26/wadl-generator-for-spring-rest/

回答by jfx

You can use Swagger-SpringMVC, which will automatically integrate Swagger compliant API-docs into your application.

您可以使用 Swagger-SpringMVC,它会自动将符合 Swagger 的 API 文档集成到您的应用程序中。

Version 1.0.2 is stable and supports Swagger 1.2.

1.0.2 版本稳定并支持 Swagger 1.2。

Version 2.0.0 is currently under development and will support Swagger 2.0.

2.0.0 版目前正在开发中,将支持 Swagger 2.0。

The api-docs will be accessible using http://localhost:8080/api-docsthen.

然后可以使用http://localhost:8080/api-docs访问 api-docs

https://github.com/springfox/springfox

https://github.com/springfox/springfox

You can also use Swagger-UI to access the API-docs and you can generate the client code using Swagger-Codegen.

您还可以使用 Swagger-UI 访问 API 文档,并且可以使用 Swagger-Codegen 生成客户端代码。