public class Docket extends java.lang.Object implements DocumentationPlugin
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_GROUP_NAME |
Constructor and Description |
---|
Docket(DocumentationType documentationType) |
Modifier and Type | Method and Description |
---|---|
Docket |
additionalModels(com.fasterxml.classmate.ResolvedType first,
com.fasterxml.classmate.ResolvedType... remaining)
Method to add additional models that are not part of any annotation or are perhaps implicit
|
Docket |
alternateTypeRules(AlternateTypeRule... alternateTypeRules)
Adds model substitution rules (alternateTypeRules)
|
Docket |
apiDescriptionOrdering(com.google.common.collect.Ordering<ApiDescription> apiDescriptionOrdering)
Controls how
io.swagger.model.ApiDescription 's are ordered. |
Docket |
apiInfo(ApiInfo apiInfo)
Sets the api's meta information as included in the json ResourceListing response.
|
Docket |
apiListingReferenceOrdering(com.google.common.collect.Ordering<ApiListingReference> apiListingReferenceOrdering)
Controls how ApiListingReference's are sorted.
|
DocumentationContext |
configure(DocumentationContextBuilder builder)
Builds the Docket by merging/overlaying user specified values.
|
Docket |
consumes(java.util.Set<java.lang.String> consumes) |
Docket |
directModelSubstitute(java.lang.Class clazz,
java.lang.Class with)
Directly substitutes a model class with the supplied substitute
e.g
directModelSubstitute(LocalDate.class, Date.class)
would substitute LocalDate with Date |
Docket |
enable(boolean externallyConfiguredFlag)
Hook to externally control auto initialization of this swagger plugin instance.
|
Docket |
enableUrlTemplating(boolean enabled)
Decides whether to use url templating for paths.
|
Docket |
extensions(java.util.List<VendorExtension> vendorExtensions)
Add to the api's vendor extensions
|
Docket |
forCodeGeneration(boolean forCodeGen)
Set this to true in order to make the documentation code generation friendly
|
Docket |
genericModelSubstitutes(java.lang.Class... genericClasses)
Substitutes each generic class with it's direct parameterized type.
|
DocumentationType |
getDocumentationType() |
java.lang.String |
getGroupName()
Gets the group name for the plugin.
|
Docket |
globalOperationParameters(java.util.List<Parameter> operationParameters)
Adds default parameters which will be applied to all operations.
|
Docket |
globalResponseMessage(org.springframework.web.bind.annotation.RequestMethod requestMethod,
java.util.List<ResponseMessage> responseMessages)
Overrides the default http response messages at the http request method level.
|
Docket |
groupName(java.lang.String groupName)
If more than one instance of Docket exists, each one must have a unique groupName as
supplied by this method.
|
Docket |
host(java.lang.String host) |
Docket |
ignoredParameterTypes(java.lang.Class... classes)
Adds ignored controller method parameter types so that the framework does not generate swagger model or parameter
information for these specific types.
|
boolean |
isEnabled() |
Docket |
operationOrdering(com.google.common.collect.Ordering<Operation> operationOrdering)
Provide an ordering schema for operations
NOTE: @see #732 in case you're wondering why
specifying position might not work.
|
Docket |
pathMapping(java.lang.String path)
Extensibility mechanism to add a servlet path mapping, if there is one, to the apis base path.
|
Docket |
pathProvider(PathProvider pathProvider)
Determines the generated, swagger specific, urls.
|
Docket |
produces(java.util.Set<java.lang.String> produces) |
Docket |
protocols(java.util.Set<java.lang.String> protocols) |
Docket |
securityContexts(java.util.List<SecurityContext> securityContexts)
Configures which api operations (via regex patterns) and HTTP methods to apply security contexts to apis.
|
Docket |
securitySchemes(java.util.List<? extends SecurityScheme> securitySchemes)
Configures the global io.swagger.model.SecurityScheme's applicable to all or some of the api
operations.
|
ApiSelectorBuilder |
select()
Initiates a builder for api selection.
|
boolean |
supports(DocumentationType delimiter) |
Docket |
tags(Tag first,
Tag... remaining)
Method to add global tags to the docket
|
Docket |
useDefaultResponseMessages(boolean apply)
Allows ignoring predefined response message defaults
|
public static final java.lang.String DEFAULT_GROUP_NAME
public Docket(DocumentationType documentationType)
public Docket extensions(java.util.List<VendorExtension> vendorExtensions)
vendorExtensions
- Indicates the vendor extension informationpublic Docket apiInfo(ApiInfo apiInfo)
apiInfo
- Indicates the api informationpublic Docket securitySchemes(java.util.List<? extends SecurityScheme> securitySchemes)
securitySchemes
- a list of security schemespublic Docket securityContexts(java.util.List<SecurityContext> securityContexts)
securityContexts
- - defines security requirements for the apispublic Docket groupName(java.lang.String groupName)
groupName
- - the unique identifier of this swagger group/configurationpublic Docket pathProvider(PathProvider pathProvider)
pathProvider
- - provides an alternate implementation of path providerAbstractPathProvider
public Docket globalResponseMessage(org.springframework.web.bind.annotation.RequestMethod requestMethod, java.util.List<ResponseMessage> responseMessages)
requestMethod
- - http request method for which to apply the messageresponseMessages
- - the messageSee swagger annotations <code>@ApiResponse</code>, <code>@ApiResponses</code>
.Defaults.defaultResponseMessages()
public Docket globalOperationParameters(java.util.List<Parameter> operationParameters)
operationParameters
- parameters which will be globally applied to all operationspublic Docket ignoredParameterTypes(java.lang.Class... classes)
classes
- the classes to ignoreDefaults.defaultIgnorableParameterTypes()
public Docket produces(java.util.Set<java.lang.String> produces)
public Docket consumes(java.util.Set<java.lang.String> consumes)
public Docket host(java.lang.String host)
public Docket protocols(java.util.Set<java.lang.String> protocols)
public Docket alternateTypeRules(AlternateTypeRule... alternateTypeRules)
alternateTypeRules
- - rules to be appliedAlternateTypeRules.newRule(java.lang.reflect.Type,
java.lang.reflect.Type)
public Docket operationOrdering(com.google.common.collect.Ordering<Operation> operationOrdering)
operationOrdering
- - ordering of the operationspublic Docket directModelSubstitute(java.lang.Class clazz, java.lang.Class with)
directModelSubstitute(LocalDate.class, Date.class)
would substitute LocalDate with Dateclazz
- class to substitutewith
- the class which substitutes 'clazz'public Docket genericModelSubstitutes(java.lang.Class... genericClasses)
List<T> or ResponseEntity<T>
.genericModelSubstitutes(ResponseEntity.class)
would substitute ResponseEntity <MyModel> with MyModelgenericClasses
- - generic classes on which to apply generic model substitution.public Docket useDefaultResponseMessages(boolean apply)
apply
- flag to determine if the default response messages are used
true - the default response messages are added to the global response messages
false - the default response messages are not added to the global response messagespublic Docket apiListingReferenceOrdering(com.google.common.collect.Ordering<ApiListingReference> apiListingReferenceOrdering)
apiListingReferenceOrdering
- - ordering of the api listing referencespublic Docket apiDescriptionOrdering(com.google.common.collect.Ordering<ApiDescription> apiDescriptionOrdering)
io.swagger.model.ApiDescription
's are ordered.
The default sort is Lexicographically by the ApiDescription's path.
NOTE: @see #732 in case you're wondering why
specifying position might not work.apiDescriptionOrdering
- - ordering of the api descriptionsApiListingScanner
public Docket enable(boolean externallyConfiguredFlag)
externallyConfiguredFlag
- - true to turn it on, false to turn it offpublic Docket forCodeGeneration(boolean forCodeGen)
forCodeGen
- - true|false determines the naming strategy usedpublic Docket pathMapping(java.lang.String path)
path
- - path that acts as a prefix to the api base pathpublic Docket enableUrlTemplating(boolean enabled)
enabled
- - when true it enables rfc6570 url templatespublic Docket additionalModels(com.fasterxml.classmate.ResolvedType first, com.fasterxml.classmate.ResolvedType... remaining)
first
- - at least one is requiredremaining
- - possible collection of morepublic Docket tags(Tag first, Tag... remaining)
first
- - at least one tag is required to use this methodremaining
- - remaining tagspublic ApiSelectorBuilder select()
public DocumentationContext configure(DocumentationContextBuilder builder)
configure
in interface DocumentationPlugin
builder
- - @see springfox.documentation.spi.service.contexts.DocumentationContextBuilderDocumentationPluginsBootstrapper
public java.lang.String getGroupName()
DocumentationPlugin
getGroupName
in interface DocumentationPlugin
public boolean isEnabled()
isEnabled
in interface DocumentationPlugin
public DocumentationType getDocumentationType()
getDocumentationType
in interface DocumentationPlugin
public boolean supports(DocumentationType delimiter)
supports
in interface org.springframework.plugin.core.Plugin<DocumentationType>