Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating API documentation from RESTEasy Annotations [duplicate]

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.

like image 352
Steve Reed Avatar asked Feb 12 '11 00:02

Steve Reed


2 Answers

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

like image 148
hisdrewness Avatar answered Oct 17 '22 19:10

hisdrewness


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! :)

like image 34
limc Avatar answered Oct 17 '22 20:10

limc