Skip to content

Documentation generation

mekor-dev edited this page Sep 29, 2020 · 1 revision

Enunciate

To generate the API documentation from the javadoc, The project is using the Enunciate lib.

Doc: https://github.com/stoicflame/enunciate

Documentation generation

The documentation is generated by Maven, by building with the docs profile

mvn clean compile package -Plocal,docs

The files are generated in src/main/webapp/docs and can be access at http://localhost:8080/rest-quickstart/docs

Useful annotations

Complete list: https://github.com/stoicflame/enunciate/wiki/Enunciate-Specific-Annotations

@TypeHint

Specify the type of a parameter or the response. Very usefull if the method returns a Response object or has a String parameter.

@GET
@TypeHint(value = User.class)
public Response sayHello() {
	return Response.entity("Hello").build();
}

@HTTP

Javadoc annotation. Specify the description for a given return code.

/**
 * Says "Hello".
 * 
 * @HTTP 200 Says Hello
 * @HTTP 500 Something happened
 */

Clone this wiki locally