public class SwaggerModule
extends com.google.inject.AbstractModule
To use this, you must provide a SwaggerConfig such as the following:
@Provides
SwaggerConfig provideSwaggerConfig(ServiceMetadata serviceMetadata) {
SwaggerConfig config = new SwaggerConfig();
config.setApiInfo(new ApiInfo(
"Name of My Service",
"A description of my service. My service lets you do some things. It's owned "
+ " by My Awesome Team",
null, null, null, null));
config.setApiVersion(serviceMetadata.getBuildInfo().getVersion());
config.setSwaggerVersion(SwaggerSpec.version());
return config;
}
Then annotate your resources, operations, and models with the Swagger annotations.
Provides the following JAX-RS resources and providers:
SwaggerApiResourceSwaggerUiResourceApiDeclarationProviderResourceListingProviderRequires:
SwaggerConfigYou may also supply set bindings for ModelConverter.
These will be added to the list of model converters (before the default converter, but otherwise
in unspecified order).
Bindings for the following are provided and used internally:
JaxrsApiReaderJaxrsScanner| Constructor and Description |
|---|
SwaggerModule() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure() |
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBindingCopyright © 2020 Cerner Innovation, Inc.. All rights reserved.