类 Docket
java.lang.Object
springfox.documentation.spring.web.plugins.Docket
- 所有已实现的接口:
org.springframework.plugin.core.Plugin<DocumentationType>,DocumentationPlugin
A builder which is intended to be the primary interface into the Springfox framework.
Provides sensible defaults and convenience methods for configuration.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明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 implicitalternateTypeRules(AlternateTypeRule... alternateTypeRules) Adds model substitution rules (alternateTypeRules)apiDescriptionOrdering(com.google.common.collect.Ordering<ApiDescription> apiDescriptionOrdering) Controls howio.swagger.model.ApiDescription's are ordered.Sets the api's meta information as included in the json ResourceListing response.apiListingReferenceOrdering(com.google.common.collect.Ordering<ApiListingReference> apiListingReferenceOrdering) Controls how ApiListingReference's are sorted.configure(DocumentationContextBuilder builder) Builds the Docket by merging/overlaying user specified values.directModelSubstitute(Class clazz, Class with) Directly substitutes a model class with the supplied substitute e.gdirectModelSubstitute(LocalDate.class, Date.class)would substitute LocalDate with Dateenable(boolean externallyConfiguredFlag) Hook to externally control auto initialization of this swagger plugin instance.enableUrlTemplating(boolean enabled) Decides whether to use url templating for paths.extensions(List<VendorExtension> vendorExtensions) Add to the api's vendor extensionsforCodeGeneration(boolean forCodeGen) Set this to true in order to make the documentation code generation friendlygenericModelSubstitutes(Class... genericClasses) Substitutes each generic class with it's direct parameterized type.globalOperationParameters(List<Parameter> operationParameters) Adds default parameters which will be applied to all operations.globalResponseMessage(org.springframework.web.bind.annotation.RequestMethod requestMethod, List<ResponseMessage> responseMessages) Overrides the default http response messages at the http request method level.If more than one instance of Docket exists, each one must have a unique groupName as supplied by this method.ignoredParameterTypes(Class... classes) Adds ignored controller method parameter types so that the framework does not generate swagger model or parameter information for these specific types.booleanoperationOrdering(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.pathMapping(String path) Extensibility mechanism to add a servlet path mapping, if there is one, to the apis base path.pathProvider(springfox.documentation.PathProvider pathProvider) Determines the generated, swagger specific, urls.securityContexts(List<SecurityContext> securityContexts) Configures which api operations (via regex patterns) and HTTP methods to apply security contexts to apis.securitySchemes(List<? extends SecurityScheme> securitySchemes) Configures the global io.swagger.model.SecurityScheme's applicable to all or some of the api operations.select()Initiates a builder for api selection.booleansupports(DocumentationType delimiter) Method to add global tags to the docketuseDefaultResponseMessages(boolean apply) Allows ignoring predefined response message defaults
-
字段详细资料
-
DEFAULT_GROUP_NAME
- 另请参阅:
-
-
构造器详细资料
-
Docket
-
-
方法详细资料
-
extensions
Add to the api's vendor extensions- 参数:
vendorExtensions- Indicates the vendor extension information- 返回:
- this Docket
-
apiInfo
Sets the api's meta information as included in the json ResourceListing response.- 参数:
apiInfo- Indicates the api information- 返回:
- this Docket
-
securitySchemes
Configures the global io.swagger.model.SecurityScheme's applicable to all or some of the api operations. The configuration of which operations have associated SecuritySchemes is configured with springfox.swagger.plugins.Docket#securityContexts- 参数:
securitySchemes- a list of security schemes- 返回:
- this Docket
-
securityContexts
Configures which api operations (via regex patterns) and HTTP methods to apply security contexts to apis.- 参数:
securityContexts- - defines security requirements for the apis- 返回:
- this Docket
-
groupName
If more than one instance of Docket exists, each one must have a unique groupName as supplied by this method. Defaults to "default".- 参数:
groupName- - the unique identifier of this swagger group/configuration- 返回:
- this Docket
-
pathProvider
Determines the generated, swagger specific, urls. By default, relative urls are generated. If absolute urls are required, supply an implementation of AbsoluteSwaggerPathProvider- 参数:
pathProvider- - provides an alternate implementation of path provider- 返回:
- this Docket
- 另请参阅:
-
globalResponseMessage
public Docket globalResponseMessage(org.springframework.web.bind.annotation.RequestMethod requestMethod, List<ResponseMessage> responseMessages) Overrides the default http response messages at the http request method level. To set specific response messages for specific api operations use the swagger core annotations on the appropriate controller methods.- 参数:
requestMethod- - http request method for which to apply the messageresponseMessages- - the message- 返回:
- this Docket and
- 另请参阅:
-
globalOperationParameters
Adds default parameters which will be applied to all operations.- 参数:
operationParameters- parameters which will be globally applied to all operations- 返回:
- this Docket
-
ignoredParameterTypes
Adds ignored controller method parameter types so that the framework does not generate swagger model or parameter information for these specific types. e.g. HttpServletRequest/HttpServletResponse which are already included in the pre-configured ignored types.- 参数:
classes- the classes to ignore- 返回:
- this Docket
- 另请参阅:
-
produces
-
consumes
-
host
-
protocols
-
alternateTypeRules
Adds model substitution rules (alternateTypeRules)- 参数:
alternateTypeRules- - rules to be applied- 返回:
- this Docket
- 另请参阅:
-
operationOrdering
Provide an ordering schema for operations NOTE: @see #732 in case you're wondering why specifying position might not work.- 参数:
operationOrdering- - ordering of the operations- 返回:
- this Docket
-
directModelSubstitute
Directly substitutes a model class with the supplied substitute e.gdirectModelSubstitute(LocalDate.class, Date.class)would substitute LocalDate with Date- 参数:
clazz- class to substitutewith- the class which substitutes 'clazz'- 返回:
- this Docket
-
genericModelSubstitutes
Substitutes each generic class with it's direct parameterized type. Use this method to only for types with a single parameterized type. e.g.List<T> or ResponseEntity<T>.genericModelSubstitutes(ResponseEntity.class)would substitute ResponseEntity <MyModel> with MyModel- 参数:
genericClasses- - generic classes on which to apply generic model substitution.- 返回:
- this Docket
-
useDefaultResponseMessages
Allows ignoring predefined response message defaults- 参数:
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 messages- 返回:
- this Docket
-
apiListingReferenceOrdering
public Docket apiListingReferenceOrdering(com.google.common.collect.Ordering<ApiListingReference> apiListingReferenceOrdering) Controls how ApiListingReference's are sorted. i.e the ordering of the api's within the swagger Resource Listing. The default sort is Lexicographically by the ApiListingReference's path NOTE: @see #732 in case you're wondering why specifying position might not work.- 参数:
apiListingReferenceOrdering- - ordering of the api listing references- 返回:
- this Docket
-
apiDescriptionOrdering
public Docket apiDescriptionOrdering(com.google.common.collect.Ordering<ApiDescription> apiDescriptionOrdering) Controls howio.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 descriptions- 返回:
- this Docket
- 另请参阅:
-
enable
Hook to externally control auto initialization of this swagger plugin instance. Typically used if defer initialization.- 参数:
externallyConfiguredFlag- - true to turn it on, false to turn it off- 返回:
- this Docket
-
forCodeGeneration
Set this to true in order to make the documentation code generation friendly- 参数:
forCodeGen- - true|false determines the naming strategy used- 返回:
- this Docket
-
pathMapping
Extensibility mechanism to add a servlet path mapping, if there is one, to the apis base path.- 参数:
path- - path that acts as a prefix to the api base path- 返回:
- this Docket
-
enableUrlTemplating
Decides whether to use url templating for paths. This is especially useful when you have search api's that might have multiple request mappings for each search use case. This is an incubating feature that may not continue to be supported after the swagger specification is modified to accommodate the use case as described in issue #711- 参数:
enabled- - when true it enables rfc6570 url templates- 返回:
- this Docket
-
additionalModels
public 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- 参数:
first- - at least one is requiredremaining- - possible collection of more- 返回:
- on-going docket
- 从以下版本开始:
- 2.4.0
-
tags
Method to add global tags to the docket- 参数:
first- - at least one tag is required to use this methodremaining- - remaining tags- 返回:
- this Docket
-
select
Initiates a builder for api selection.- 返回:
- api selection builder. To complete building the api selector, the build method of the api selector needs to be called, this will automatically fall back to building the docket when the build method is called.
-
configure
Builds the Docket by merging/overlaying user specified values. It is not necessary to call this method when defined as a spring bean. NOTE: Calling this method more than once has no effect.- 指定者:
configure在接口中DocumentationPlugin- 另请参阅:
-
getGroupName
- 指定者:
getGroupName在接口中DocumentationPlugin
-
isEnabled
public boolean isEnabled()- 指定者:
isEnabled在接口中DocumentationPlugin
-
getDocumentationType
- 指定者:
getDocumentationType在接口中DocumentationPlugin
-
supports
- 指定者:
supports在接口中org.springframework.plugin.core.Plugin<DocumentationType>
-