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:
SwaggerApiResource
SwaggerUiResource
ApiDeclarationProvider
ResourceListingProvider
Requires:
SwaggerConfig
You 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:
JaxrsApiReader
JaxrsScanner
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, requireBinding
Copyright © 2020 Cerner Innovation, Inc.. All rights reserved.