This library contains a RamlGenerator
class that will generate a RAML specification for an application based on a combination of toolbox and JAX-RS annotations.
The resulting output of the RamlGenerator.generate()
command is a String
representation of the derived RAML.
<dependency>
<groupId>net.ozwolf</groupId>
<artifactId>dropwizard-raml-generator</artifactId>
<version>2.1.0</version>
</dependency>
compile 'net.ozwolf:dropwizard-raml-generator:2.1.0'
Currently, the generator only supports schema and example generation for application/json
and text/xml
content.
If your resources return other content types, then resource files will need to be supplied manually.
try {
String raml = new RamlGenerator("com.test.app", "1.2.3").generate();
} catch(RamlGenerationException e){}
LOGGER.error("Error generating RAML specification.", e);
}