This library contains a DropWizard Bundle
that can be added to your service with the goal of providing a human-readable endpoint for describing your API specification.
The bundle will log errors and and return 503 Service Unavailable
errors if there is an issue trying to initialize the bundle.
It will not cause the application from starting.
Note: Due to current limitations in Mulesoft's JVM libraries, the bundle is currently unable to provide a raw dump of the RAML specification at runtime.
<dependency>
<groupId>net.ozwolf</groupId>
<artifactId>dropwizard-raml-apidocs</artifactId>
<version>2.1.0</version>
</dependency>
compile 'net.ozwolf:dropwizard-raml-generator:2.1.0'
public class MyApp extends Application<MyAppConfiguration> {
@Override
public String getName() {
return "my-app";
}
@Override
public void initialize(Bootstrap<MyAppConfiguration> bootstrap){
bootstrap.addBundle(new ApiDocsBundle("com.my.app", PropertyUtils.getValueFrom("application.properties", "version")));
}
}
public class MyApp extends Application<MyAppConfiguration> {
@Override
public String getName() {
return "my-app";
}
@Override
public void initialize(Bootstrap<MyAppConfiguration> bootstrap){
bootstrap.addBundle(new ApiDocsBundle("apidocs/apidocs.yml"));
}
}
Your API specifications can then be viewed via the /apidocs
resource on your application's operations pot.