|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin
public class SwaggerSpringMvcPlugin
A builder which is intended to be the primary interface into the swagger-springmvc framework. Provides sensible defaults and convenience methods for configuration.
| Constructor Summary | |
|---|---|
SwaggerSpringMvcPlugin(SpringSwaggerConfig springSwaggerConfig)
Default constructor. |
|
| Method Summary | |
|---|---|
SwaggerSpringMvcPlugin |
alternateTypeProvider(com.mangofactory.swagger.models.alternates.AlternateTypeProvider alternateTypeProvider)
Overrides the default AlternateTypeProvider. |
SwaggerSpringMvcPlugin |
alternateTypeRules(com.mangofactory.swagger.models.alternates.AlternateTypeRule... alternateTypeRules)
Adds model substitution rules (alternateTypeRules) |
SwaggerSpringMvcPlugin |
apiDescriptionOrdering(com.google.common.collect.Ordering<com.mangofactory.swagger.models.dto.ApiDescription> apiDescriptionOrdering)
Controls how com.wordnik.swagger.model.ApiDescription's are ordered. |
SwaggerSpringMvcPlugin |
apiInfo(com.mangofactory.swagger.models.dto.ApiInfo apiInfo)
Sets the api's meta information as included in the json ResourceListing response. |
SwaggerSpringMvcPlugin |
apiListingReferenceOrdering(com.google.common.collect.Ordering<com.mangofactory.swagger.models.dto.ApiListingReference> apiListingReferenceOrdering)
Controls how ApiListingReference's are sorted. |
SwaggerSpringMvcPlugin |
apiVersion(java.lang.String apiVersion)
Sets the api version. |
SwaggerSpringMvcPlugin |
authorizationContext(AuthorizationContext authorizationContext)
Configures which api operations (via regex patterns) and HTTP methods to apply swagger authorization to. |
SwaggerSpringMvcPlugin |
authorizationTypes(java.util.List<com.mangofactory.swagger.models.dto.AuthorizationType> authorizationTypes)
Configures the global com.wordnik.swagger.model.AuthorizationType's applicable to all or some of the api operations. |
SwaggerSpringMvcPlugin |
build()
Builds the SwaggerSpringMvcPlugin by merging/overlaying user specified values. |
SwaggerSpringMvcPlugin |
customAnnotationReaders(java.util.Collection<RequestMappingReader> customAnnotationReaders)
Hook for adding custom annotations readers. |
SwaggerSpringMvcPlugin |
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 |
SwaggerSpringMvcPlugin |
enable(boolean externallyConfiguredFlag)
Hook to externally control auto initialization of this swagger plugin instance. |
SwaggerSpringMvcPlugin |
excludeAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation>... excludeAnnotations)
Spring controllers or request mappings with these annotations will be excluded from the generated swagger JSON. |
SwaggerSpringMvcPlugin |
genericModelSubstitutes(java.lang.Class... genericClasses)
Substitutes each generic class with it's direct parameterized type. |
SwaggerSpringMvcPlugin |
genericTypeNamingStrategy(com.mangofactory.swagger.models.GenericTypeNamingStrategy strategy)
Controls how generics are encoded as swagger types, specifically around the characters used to open, close, and delimit lists of types. |
SwaggerSpringMvcPlugin |
globalResponseMessage(org.springframework.web.bind.annotation.RequestMethod requestMethod,
java.util.List<com.mangofactory.swagger.models.dto.ResponseMessage> responseMessages)
Overrides the default http response messages at the http request method level. |
SwaggerSpringMvcPlugin |
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. |
SwaggerSpringMvcPlugin |
includePatterns(java.lang.String... includePatterns)
Controls which controllers, more specifically, which Spring RequestMappings to include in the swagger Resource Listing. |
protected void |
initialize()
Called by the framework hence protected |
boolean |
isEnabled()
|
SwaggerSpringMvcPlugin |
modelProvider(com.mangofactory.swagger.models.ModelProvider modelProvider)
Overrides the default com.mangofactory.swagger.models.ModelProvider |
SwaggerSpringMvcPlugin |
pathProvider(SwaggerPathProvider swaggerPathProvider)
Determines the generated, swagger specific, urls. |
SwaggerSpringMvcPlugin |
requestMappingPatternMatcher(RequestMappingPatternMatcher requestMappingPatternMatcher)
Hook for adding custom annotations readers. |
SwaggerSpringMvcPlugin |
resourceGroupingStrategy(ResourceGroupingStrategy resourceGroupingStrategy)
Controls which ResourceListing's, RequestMappings belong to. |
SwaggerSpringMvcPlugin |
swaggerGroup(java.lang.String swaggerGroup)
If more than one instance of SwaggerSpringMvcPlugin exists, each one must have a unique swaggerGroup as supplied by this method. |
SwaggerSpringMvcPlugin |
useDefaultResponseMessages(boolean apply)
Allows ignoring predefined response message defaults |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SwaggerSpringMvcPlugin(SpringSwaggerConfig springSwaggerConfig)
springSwaggerConfig - | Method Detail |
|---|
public SwaggerSpringMvcPlugin apiInfo(com.mangofactory.swagger.models.dto.ApiInfo apiInfo)
apiInfo -
public SwaggerSpringMvcPlugin authorizationTypes(java.util.List<com.mangofactory.swagger.models.dto.AuthorizationType> authorizationTypes)
authorizationTypes - a list of global AuthorizationType's
public SwaggerSpringMvcPlugin authorizationContext(AuthorizationContext authorizationContext)
authorizationContext -
public SwaggerSpringMvcPlugin swaggerGroup(java.lang.String swaggerGroup)
swaggerGroup - - the unique identifier of this swagger group/configuration
public SwaggerSpringMvcPlugin pathProvider(SwaggerPathProvider swaggerPathProvider)
swaggerPathProvider -
SwaggerPathProviderpublic SwaggerSpringMvcPlugin excludeAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation>... excludeAnnotations)
excludeAnnotations - one or more java Annotation classes
public SwaggerSpringMvcPlugin includePatterns(java.lang.String... includePatterns)
com.mangofactory.swagger.scanners.RequestMappingPatternMatcheris used to match a
given org.springframework.web.servlet.mvc.condition.PatternsRequestCondition against the
includePatterns supplied here.
RegexRequestMappingPatternMatcher is the default implementation and requires these includePatterns
are valid regular expressions.
If not supplied a single pattern ".*?" is used which matches anything and hence all RequestMappings.
includePatterns - - the regular expressions to determine which Spring RequestMappings to include.
public SwaggerSpringMvcPlugin globalResponseMessage(org.springframework.web.bind.annotation.RequestMethod requestMethod,
java.util.List<com.mangofactory.swagger.models.dto.ResponseMessage> responseMessages)
requestMethod - - http request method for which to apply the messageresponseMessages - - the message
and,
ApiResponses,
SpringSwaggerConfig.defaultResponseMessages()public SwaggerSpringMvcPlugin ignoredParameterTypes(java.lang.Class... classes)
classes - the classes to ignore
SpringSwaggerConfig.defaultIgnorableParameterTypes()public SwaggerSpringMvcPlugin alternateTypeProvider(com.mangofactory.swagger.models.alternates.AlternateTypeProvider alternateTypeProvider)
alternateTypeProvider -
public SwaggerSpringMvcPlugin apiVersion(java.lang.String apiVersion)
apiVersion -
public SwaggerSpringMvcPlugin modelProvider(com.mangofactory.swagger.models.ModelProvider modelProvider)
com.mangofactory.swagger.models.ModelProvider
modelProvider -
public SwaggerSpringMvcPlugin alternateTypeRules(com.mangofactory.swagger.models.alternates.AlternateTypeRule... alternateTypeRules)
alternateTypeRules -
Alternates.newRule(java.lang.reflect.Type, java.lang.reflect.Type)
public SwaggerSpringMvcPlugin directModelSubstitute(java.lang.Class clazz,
java.lang.Class with)
directModelSubstitute(LocalDate.class, Date.class)
would substitute LocalDate with Date
clazz - class to substitutewith - the class which substitutes 'clazz'
public SwaggerSpringMvcPlugin 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 added to the global response messages
public SwaggerSpringMvcPlugin genericModelSubstitutes(java.lang.Class... genericClasses)
.genericModelSubstitutes(ResponseEntity.class)
would substitute ResponseEntity <MyModel> with MyModel
genericClasses - - generic classes on which to apply generic model substitution.
public SwaggerSpringMvcPlugin genericTypeNamingStrategy(com.mangofactory.swagger.models.GenericTypeNamingStrategy strategy)
strategy - a GenericTypeNamingStrategy implementation, defaults to DefaultGenericTypeNamingStrategy
public SwaggerSpringMvcPlugin apiListingReferenceOrdering(com.google.common.collect.Ordering<com.mangofactory.swagger.models.dto.ApiListingReference> apiListingReferenceOrdering)
apiListingReferenceOrdering -
public SwaggerSpringMvcPlugin apiDescriptionOrdering(com.google.common.collect.Ordering<com.mangofactory.swagger.models.dto.ApiDescription> apiDescriptionOrdering)
com.wordnik.swagger.model.ApiDescription's are ordered.
The default sort is Lexicographically by the ApiDescription's path.
apiDescriptionOrdering -
ApiListingScannerpublic SwaggerSpringMvcPlugin resourceGroupingStrategy(ResourceGroupingStrategy resourceGroupingStrategy)
resourceGroupingStrategy -
ApiListingReferenceScanner.scanSpringRequestMappings()public SwaggerSpringMvcPlugin customAnnotationReaders(java.util.Collection<RequestMappingReader> customAnnotationReaders)
customAnnotationReaders - list of RequestMappingReader
public SwaggerSpringMvcPlugin requestMappingPatternMatcher(RequestMappingPatternMatcher requestMappingPatternMatcher)
requestMappingPatternMatcher - an implementation of .RequestMappingPatternMatcher. Out of the box the library comes with
RegexRequestMappingPatternMatcher and
AntRequestMappingPatternMatcher
public SwaggerSpringMvcPlugin enable(boolean externallyConfiguredFlag)
externallyConfiguredFlag - - true to turn it on, false to turn it off
protected void initialize()
public SwaggerSpringMvcPlugin build()
SwaggerPluginAdapterpublic boolean isEnabled()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||