public abstract class AbstractOpenApiResource
extends io.swagger.v3.core.filter.SpecFilter
Modifier and Type | Field and Description |
---|---|
protected String |
groupName
The Group name.
|
protected OpenAPIService |
openAPIService
The Open api builder.
|
protected SpringDocConfigProperties |
springDocConfigProperties
The Spring doc config properties.
|
protected SpringDocCustomizers |
springDocCustomizers
The Spring doc customizers.
|
protected SpringDocProviders |
springDocProviders
The Spring doc providers.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractOpenApiResource(String groupName,
org.springframework.beans.factory.ObjectFactory<OpenAPIService> openAPIBuilderObjectFactory,
AbstractRequestService requestBuilder,
GenericResponseService responseBuilder,
OperationService operationParser,
SpringDocConfigProperties springDocConfigProperties,
SpringDocProviders springDocProviders,
SpringDocCustomizers springDocCustomizers)
Instantiates a new Abstract open api resource.
|
Modifier and Type | Method and Description |
---|---|
static void |
addHiddenRestControllers(Class<?>... classes)
Add hidden rest controllers.
|
static void |
addHiddenRestControllers(String... classes)
Add hidden rest controllers.
|
static void |
addRestControllers(Class<?>... classes)
Add rest controllers.
|
protected void |
calculatePath(org.springframework.web.method.HandlerMethod handlerMethod,
RouterOperation routerOperation,
Locale locale,
io.swagger.v3.oas.models.OpenAPI openAPI)
Calculate path.
|
protected void |
calculatePath(org.springframework.web.method.HandlerMethod handlerMethod,
String operationPath,
Set<org.springframework.web.bind.annotation.RequestMethod> requestMethods,
String[] consumes,
String[] produces,
String[] headers,
String[] params,
Locale locale,
io.swagger.v3.oas.models.OpenAPI openAPI)
Calculate path.
|
protected void |
calculatePath(List<RouterOperation> routerOperationList,
Locale locale,
io.swagger.v3.oas.models.OpenAPI openAPI)
Calculate path.
|
protected void |
calculatePath(RouterOperation routerOperation,
Locale locale,
io.swagger.v3.oas.models.OpenAPI openAPI)
Calculate path.
|
static boolean |
containsResponseBody(org.springframework.web.method.HandlerMethod handlerMethod)
Contains response body boolean.
|
protected io.swagger.v3.oas.models.Operation |
customizeOperation(io.swagger.v3.oas.models.Operation operation,
org.springframework.web.method.HandlerMethod handlerMethod)
Customise operation operation.
|
protected RouterOperation |
customizeRouterOperation(RouterOperation routerOperation,
org.springframework.web.method.HandlerMethod handlerMethod)
Customise router operation
|
protected String |
decode(String requestURI)
Decode string.
|
protected URI |
getActuatorURI(String scheme,
String host)
Gets actuator uri.
|
protected Set<org.springframework.web.bind.annotation.RequestMethod> |
getDefaultAllowedHttpMethods()
Gets default allowed http methods.
|
protected io.swagger.v3.oas.models.OpenAPI |
getOpenApi(Locale locale)
Gets open api.
|
protected abstract void |
getPaths(Map<String,Object> findRestControllers,
Locale locale,
io.swagger.v3.oas.models.OpenAPI openAPI)
Gets paths.
|
protected void |
getRouterFunctionPaths(String beanName,
AbstractRouterFunctionVisitor routerFunctionVisitor,
Locale locale,
io.swagger.v3.oas.models.OpenAPI openAPI)
Gets router function paths.
|
protected void |
initOpenAPIBuilder(Locale locale)
Init open api builder.
|
protected boolean |
isActuatorRestController(String operationPath,
org.springframework.web.method.HandlerMethod handlerMethod)
Is actuator rest controller boolean.
|
protected boolean |
isAdditionalRestController(Class<?> rawClass)
Is additional rest controller boolean.
|
protected boolean |
isConditionToMatch(String[] existingConditions,
org.springdoc.api.AbstractOpenApiResource.ConditionType conditionType)
Is condition to match boolean.
|
protected boolean |
isFilterCondition(org.springframework.web.method.HandlerMethod handlerMethod,
String operationPath,
String[] produces,
String[] consumes,
String[] headers)
Is filter condition boolean.
|
static boolean |
isHiddenRestControllers(Class<?> rawClass)
Is hidden rest controllers boolean.
|
protected boolean |
isMethodToFilter(org.springframework.web.method.HandlerMethod handlerMethod)
Is target method suitable for inclusion in current documentation/
|
protected boolean |
isPackageToScan(Package aPackage)
Is package to scan boolean.
|
protected boolean |
isPathToMatch(String operationPath)
Is path to match boolean.
|
protected boolean |
isRestController(Map<String,Object> restControllers,
org.springframework.web.method.HandlerMethod handlerMethod,
String operationPath)
Is rest controller boolean.
|
protected void |
mergeRouters(List<RouterFunctionData> routerFunctionDatas,
List<RouterOperation> routerOperationList)
Merge routers.
|
static void |
setModelAndViewClass(Class<?> modelAndViewClass)
Sets model and view class.
|
protected byte[] |
writeJsonValue(io.swagger.v3.oas.models.OpenAPI openAPI)
Write json value string.
|
protected byte[] |
writeYamlValue(io.swagger.v3.oas.models.OpenAPI openAPI)
Write yaml value string.
|
protected final SpringDocConfigProperties springDocConfigProperties
protected final String groupName
protected final SpringDocProviders springDocProviders
protected OpenAPIService openAPIService
protected final SpringDocCustomizers springDocCustomizers
protected AbstractOpenApiResource(String groupName, org.springframework.beans.factory.ObjectFactory<OpenAPIService> openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers)
groupName
- the group nameopenAPIBuilderObjectFactory
- the open api builder object factoryrequestBuilder
- the request builderresponseBuilder
- the response builderoperationParser
- the operation parserspringDocConfigProperties
- the spring doc config propertiesspringDocProviders
- the spring doc providersspringDocCustomizers
- the spring doc customizerspublic static void addRestControllers(Class<?>... classes)
classes
- the classespublic static void addHiddenRestControllers(Class<?>... classes)
classes
- the classespublic static void addHiddenRestControllers(String... classes)
classes
- the classespublic static boolean containsResponseBody(org.springframework.web.method.HandlerMethod handlerMethod)
handlerMethod
- the handler methodpublic static boolean isHiddenRestControllers(Class<?> rawClass)
rawClass
- the raw classpublic static void setModelAndViewClass(Class<?> modelAndViewClass)
modelAndViewClass
- the model and view classprotected io.swagger.v3.oas.models.OpenAPI getOpenApi(Locale locale)
locale
- the localeprotected abstract void getPaths(Map<String,Object> findRestControllers, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
findRestControllers
- the find rest controllerslocale
- the localeopenAPI
- the open apiprotected void calculatePath(org.springframework.web.method.HandlerMethod handlerMethod, RouterOperation routerOperation, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
handlerMethod
- the handler methodrouterOperation
- the router operationlocale
- the localeopenAPI
- the open apiprotected void calculatePath(List<RouterOperation> routerOperationList, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
routerOperationList
- the router operation listlocale
- the localeopenAPI
- the open apiprotected void calculatePath(RouterOperation routerOperation, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
routerOperation
- the router operationlocale
- the localeprotected void calculatePath(org.springframework.web.method.HandlerMethod handlerMethod, String operationPath, Set<org.springframework.web.bind.annotation.RequestMethod> requestMethods, String[] consumes, String[] produces, String[] headers, String[] params, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
handlerMethod
- the handler methodoperationPath
- the operation pathrequestMethods
- the request methodsconsumes
- the consumesproduces
- the producesheaders
- the headersparams
- the paramslocale
- the localeopenAPI
- the open apiprotected void getRouterFunctionPaths(String beanName, AbstractRouterFunctionVisitor routerFunctionVisitor, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
beanName
- the bean namerouterFunctionVisitor
- the router function visitorlocale
- the localeopenAPI
- the open apiprotected boolean isFilterCondition(org.springframework.web.method.HandlerMethod handlerMethod, String operationPath, String[] produces, String[] consumes, String[] headers)
handlerMethod
- the handler methodoperationPath
- the operation pathproduces
- the producesconsumes
- the consumesheaders
- the headersprotected boolean isMethodToFilter(org.springframework.web.method.HandlerMethod handlerMethod)
handlerMethod
- the method to checkprotected boolean isConditionToMatch(String[] existingConditions, org.springdoc.api.AbstractOpenApiResource.ConditionType conditionType)
existingConditions
- the existing conditionsconditionType
- the condition typeprotected boolean isPackageToScan(Package aPackage)
aPackage
- the a packageprotected boolean isPathToMatch(String operationPath)
operationPath
- the operation pathprotected String decode(String requestURI)
requestURI
- the request uriprotected boolean isAdditionalRestController(Class<?> rawClass)
rawClass
- the raw classprotected boolean isRestController(Map<String,Object> restControllers, org.springframework.web.method.HandlerMethod handlerMethod, String operationPath)
restControllers
- the rest controllershandlerMethod
- the handler methodoperationPath
- the operation pathprotected Set<org.springframework.web.bind.annotation.RequestMethod> getDefaultAllowedHttpMethods()
protected io.swagger.v3.oas.models.Operation customizeOperation(io.swagger.v3.oas.models.Operation operation, org.springframework.web.method.HandlerMethod handlerMethod)
operation
- the operationhandlerMethod
- the handler methodprotected RouterOperation customizeRouterOperation(RouterOperation routerOperation, org.springframework.web.method.HandlerMethod handlerMethod)
routerOperation
- the router operationhandlerMethod
- the handler methodprotected void mergeRouters(List<RouterFunctionData> routerFunctionDatas, List<RouterOperation> routerOperationList)
routerFunctionDatas
- the router function datasrouterOperationList
- the router operation listprotected void initOpenAPIBuilder(Locale locale)
locale
- the localeprotected byte[] writeYamlValue(io.swagger.v3.oas.models.OpenAPI openAPI) throws com.fasterxml.jackson.core.JsonProcessingException
openAPI
- the open apicom.fasterxml.jackson.core.JsonProcessingException
- the json processing exceptionprotected URI getActuatorURI(String scheme, String host)
scheme
- the schemehost
- the hostprotected boolean isActuatorRestController(String operationPath, org.springframework.web.method.HandlerMethod handlerMethod)
operationPath
- the operation pathhandlerMethod
- the handler methodprotected byte[] writeJsonValue(io.swagger.v3.oas.models.OpenAPI openAPI) throws com.fasterxml.jackson.core.JsonProcessingException
openAPI
- the open apicom.fasterxml.jackson.core.JsonProcessingException
- the json processing exceptionCopyright © 2024. All rights reserved.