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 Optional<ActuatorProvider> |
optionalActuatorProvider
The Actuator provider.
|
protected SpringDocConfigProperties |
springDocConfigProperties
The Spring doc config properties.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractOpenApiResource(String groupName,
org.springframework.beans.factory.ObjectFactory<OpenAPIService> openAPIBuilderObjectFactory,
AbstractRequestService requestBuilder,
GenericResponseService responseBuilder,
OperationService operationParser,
Optional<List<OperationCustomizer>> operationCustomizers,
Optional<List<OpenApiCustomiser>> openApiCustomisers,
SpringDocConfigProperties springDocConfigProperties,
Optional<ActuatorProvider> actuatorProvider)
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)
Calculate path.
|
protected void |
calculatePath(org.springframework.web.method.HandlerMethod handlerMethod,
String operationPath,
Set<org.springframework.web.bind.annotation.RequestMethod> requestMethods)
Calculate path.
|
protected void |
calculatePath(List<RouterOperation> routerOperationList)
Calculate path.
|
protected void |
calculatePath(RouterOperation routerOperation)
Calculate path.
|
protected io.swagger.v3.oas.models.Operation |
customiseOperation(io.swagger.v3.oas.models.Operation operation,
org.springframework.web.method.HandlerMethod handlerMethod)
Customise operation 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()
Gets open api.
|
protected abstract void |
getPaths(Map<String,Object> findRestControllers)
Gets paths.
|
protected void |
getRouterFunctionPaths(String beanName,
AbstractRouterFunctionVisitor routerFunctionVisitor)
Gets router function paths.
|
protected void |
initOpenAPIBuilder()
Init open api builder.
|
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 |
isPackageToScan(Package aPackage)
Is package to scan boolean.
|
protected boolean |
isPathToMatch(String operationPath)
Is path to match boolean.
|
protected boolean |
isShowActuator()
Is show actuator boolean.
|
protected void |
mergeRouters(List<RouterFunctionData> routerFunctionDatas,
List<RouterOperation> routerOperationList)
Merge routers.
|
protected String |
writeJsonValue(io.swagger.v3.oas.models.OpenAPI openAPI)
Write json value string.
|
protected String |
writeYamlValue(io.swagger.v3.oas.models.OpenAPI openAPI)
Write yaml value string.
|
protected OpenAPIService openAPIService
protected final SpringDocConfigProperties springDocConfigProperties
protected final Optional<ActuatorProvider> optionalActuatorProvider
protected final String groupName
protected AbstractOpenApiResource(String groupName, org.springframework.beans.factory.ObjectFactory<OpenAPIService> openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, Optional<List<OperationCustomizer>> operationCustomizers, Optional<List<OpenApiCustomiser>> openApiCustomisers, SpringDocConfigProperties springDocConfigProperties, Optional<ActuatorProvider> actuatorProvider)
groupName
- the group nameopenAPIBuilderObjectFactory
- the open api builder object factoryrequestBuilder
- the request builderresponseBuilder
- the response builderoperationParser
- the operation parseroperationCustomizers
- the operation customizersopenApiCustomisers
- the open api customisersspringDocConfigProperties
- the spring doc config propertiesactuatorProvider
- the actuator providerpublic static void addRestControllers(Class<?>... classes)
classes
- the classespublic static void addHiddenRestControllers(Class<?>... classes)
classes
- the classespublic static void addHiddenRestControllers(String... classes)
classes
- the classesprotected io.swagger.v3.oas.models.OpenAPI getOpenApi()
protected abstract void getPaths(Map<String,Object> findRestControllers)
findRestControllers
- the find rest controllersprotected void calculatePath(org.springframework.web.method.HandlerMethod handlerMethod, RouterOperation routerOperation)
handlerMethod
- the handler methodrouterOperation
- the router operationprotected void calculatePath(List<RouterOperation> routerOperationList)
routerOperationList
- the router operation listprotected void calculatePath(RouterOperation routerOperation)
routerOperation
- the router operationprotected void calculatePath(org.springframework.web.method.HandlerMethod handlerMethod, String operationPath, Set<org.springframework.web.bind.annotation.RequestMethod> requestMethods)
handlerMethod
- the handler methodoperationPath
- the operation pathrequestMethods
- the request methodsprotected void getRouterFunctionPaths(String beanName, AbstractRouterFunctionVisitor routerFunctionVisitor)
beanName
- the bean namerouterFunctionVisitor
- the router function visitorprotected 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 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 classpublic static boolean isHiddenRestControllers(Class<?> rawClass)
rawClass
- the raw classprotected Set<org.springframework.web.bind.annotation.RequestMethod> getDefaultAllowedHttpMethods()
protected io.swagger.v3.oas.models.Operation customiseOperation(io.swagger.v3.oas.models.Operation operation, org.springframework.web.method.HandlerMethod handlerMethod)
operation
- the operationhandlerMethod
- the handler methodprotected void mergeRouters(List<RouterFunctionData> routerFunctionDatas, List<RouterOperation> routerOperationList)
routerFunctionDatas
- the router function datasrouterOperationList
- the router operation listprotected void initOpenAPIBuilder()
protected String 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 isShowActuator()
protected String 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 © 2021. All rights reserved.