Are there javadoc-like tools to generate RESTful web service apidoc from JAX-RS annotations? [closed]

让人想犯罪 __ 提交于 2019-11-29 06:10:31

问题


I'm developing a web service with CXF by using JAX-RS annotations on resources. These annotations specify arguments names, default values, and the valid input and output mime types.

It'd be nice to be able to run a javadoc-esque tool on my code to generate a concise set of documentation of this interface, but I cannot seem to find anything.

The docs produced by javadoc itself would require too much trimming down, I really want something that understands the semantics of the JAX-RS annotations and generates something friendly to the devs who want to use my service.


回答1:


If you are building Restful webservices, the documentation is known as WADL. WADL is basically Rest's version of WSDL. I use Jersey to build my Restful web services. Jersey automatically creates the WADL based on the annotations you have in your resources package. Here's how the sample WADL looks like from Jersey's website: https://java.net/projects/jersey/sources/svn/show/trunk/jersey/samples/generate-wadl

The best part of this is you do absolutely nothing. :) When you change the URI or parameters annotation in your Resource classes, they will be automatically reflected in this documentation.

TADAA! :)




回答2:


Take a look at Enunciate. There's a Maven plugin that will generate docs included in the site.



来源:https://stackoverflow.com/questions/4975525/are-there-javadoc-like-tools-to-generate-restful-web-service-apidoc-from-jax-rs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!