Package org.springdoc.core.service
Class AbstractRequestService
java.lang.Object
org.springdoc.core.service.AbstractRequestService
The type Abstract request builder.
- Author:
- bnasslahsen
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractRequestService
(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, SpringDocCustomizers springDocCustomizers, SpringDocParameterNameDiscoverer localSpringDocParameterNameDiscoverer, MethodParameterPojoExtractor methodParameterPojoExtractor) Instantiates a new Abstract request builder. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addRequestWrapperToIgnore
(Class<?>... classes) Add request wrapper to ignore.void
applyBeanValidatorAnnotations
(io.swagger.v3.oas.models.parameters.RequestBody requestBody, List<Annotation> annotations, boolean isOptional) Apply bean validator annotations.void
applyBeanValidatorAnnotations
(org.springframework.core.MethodParameter methodParameter, io.swagger.v3.oas.models.parameters.Parameter parameter, List<Annotation> annotations, boolean isParameterObject, String openapiVersion) Apply bean validator annotations.io.swagger.v3.oas.models.Operation
build
(org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.bind.annotation.RequestMethod requestMethod, io.swagger.v3.oas.models.Operation operation, MethodAttributes methodAttributes, io.swagger.v3.oas.models.OpenAPI openAPI) Build operation.io.swagger.v3.oas.models.parameters.Parameter
buildParam
(ParameterInfo parameterInfo, io.swagger.v3.oas.models.Components components, com.fasterxml.jackson.annotation.JsonView jsonView) Build param parameter.io.swagger.v3.oas.models.parameters.Parameter
buildParams
(ParameterInfo parameterInfo, io.swagger.v3.oas.models.Components components, org.springframework.web.bind.annotation.RequestMethod requestMethod, MethodAttributes methodAttributes, String openApiVersion) Build params parameter.protected void
customiseParameter
(io.swagger.v3.oas.models.parameters.Parameter parameter, ParameterInfo parameterInfo, List<io.swagger.v3.oas.models.parameters.Parameter> operationParameters) Customise parameter parameter.static Collection<io.swagger.v3.oas.models.parameters.Parameter>
getHeaders
(MethodAttributes methodAttributes, Map<ParameterId, io.swagger.v3.oas.models.parameters.Parameter> map) Gets headers.Gets method parameter pojo extractor.Gets optional delegating method parameter customizers.Gets parameter builder.Gets request body builder.boolean
Is default flat param object boolean.boolean
isParamToIgnore
(org.springframework.core.MethodParameter parameter) Is param to ignore boolean.static boolean
isRequestTypeToIgnore
(Class<?> rawClass) Is request type to ignore boolean.boolean
isValidParameter
(io.swagger.v3.oas.models.parameters.Parameter parameter, MethodAttributes methodAttributes) Is valid parameter boolean.static void
removeRequestWrapperToIgnore
(Class<?>... classes) Remove request wrapper to ignore.
-
Constructor Details
-
AbstractRequestService
protected AbstractRequestService(GenericParameterService parameterBuilder, RequestBodyService requestBodyService, SpringDocCustomizers springDocCustomizers, SpringDocParameterNameDiscoverer localSpringDocParameterNameDiscoverer, MethodParameterPojoExtractor methodParameterPojoExtractor) Instantiates a new Abstract request builder.- Parameters:
parameterBuilder
- the parameter builderrequestBodyService
- the request body builderspringDocCustomizers
- the spring doc customizerslocalSpringDocParameterNameDiscoverer
- the local spring doc parameter name discoverermethodParameterPojoExtractor
- the method parameter pojo extractor
-
-
Method Details
-
addRequestWrapperToIgnore
Add request wrapper to ignore.- Parameters:
classes
- the classes
-
removeRequestWrapperToIgnore
Remove request wrapper to ignore.- Parameters:
classes
- the classes
-
isRequestTypeToIgnore
Is request type to ignore boolean.- Parameters:
rawClass
- the raw class- Returns:
- the boolean
-
getHeaders
public static Collection<io.swagger.v3.oas.models.parameters.Parameter> getHeaders(MethodAttributes methodAttributes, Map<ParameterId, io.swagger.v3.oas.models.parameters.Parameter> map) Gets headers.- Parameters:
methodAttributes
- the method attributesmap
- the map- Returns:
- the headers
-
build
public io.swagger.v3.oas.models.Operation build(org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.bind.annotation.RequestMethod requestMethod, io.swagger.v3.oas.models.Operation operation, MethodAttributes methodAttributes, io.swagger.v3.oas.models.OpenAPI openAPI) Build operation.- Parameters:
handlerMethod
- the handler methodrequestMethod
- the request methodoperation
- the operationmethodAttributes
- the method attributesopenAPI
- the open api- Returns:
- the operation
- See Also:
-
customiseParameter
protected void customiseParameter(io.swagger.v3.oas.models.parameters.Parameter parameter, ParameterInfo parameterInfo, List<io.swagger.v3.oas.models.parameters.Parameter> operationParameters) Customise parameter parameter.- Parameters:
parameter
- the parameterparameterInfo
- the parameter infooperationParameters
- the operation parameters
-
isParamToIgnore
public boolean isParamToIgnore(org.springframework.core.MethodParameter parameter) Is param to ignore boolean.- Parameters:
parameter
- the parameter- Returns:
- the boolean
-
isValidParameter
public boolean isValidParameter(io.swagger.v3.oas.models.parameters.Parameter parameter, MethodAttributes methodAttributes) Is valid parameter boolean.- Parameters:
parameter
- the parametermethodAttributes
- the method attributes- Returns:
- the boolean
-
buildParams
public io.swagger.v3.oas.models.parameters.Parameter buildParams(ParameterInfo parameterInfo, io.swagger.v3.oas.models.Components components, org.springframework.web.bind.annotation.RequestMethod requestMethod, MethodAttributes methodAttributes, String openApiVersion) Build params parameter.- Parameters:
parameterInfo
- the parameter infocomponents
- the componentsrequestMethod
- the request methodmethodAttributes
- the method attributesopenApiVersion
- the open api version- Returns:
- the parameter
-
buildParam
public io.swagger.v3.oas.models.parameters.Parameter buildParam(ParameterInfo parameterInfo, io.swagger.v3.oas.models.Components components, com.fasterxml.jackson.annotation.JsonView jsonView) Build param parameter.- Parameters:
parameterInfo
- the parameter infocomponents
- the componentsjsonView
- the json view- Returns:
- the parameter
-
applyBeanValidatorAnnotations
public void applyBeanValidatorAnnotations(org.springframework.core.MethodParameter methodParameter, io.swagger.v3.oas.models.parameters.Parameter parameter, List<Annotation> annotations, boolean isParameterObject, String openapiVersion) Apply bean validator annotations.- Parameters:
methodParameter
- the method parameterparameter
- the parameterannotations
- the annotationsisParameterObject
- the is parameter objectopenapiVersion
- the openapi version
-
applyBeanValidatorAnnotations
public void applyBeanValidatorAnnotations(io.swagger.v3.oas.models.parameters.RequestBody requestBody, List<Annotation> annotations, boolean isOptional) Apply bean validator annotations.- Parameters:
requestBody
- the request bodyannotations
- the annotationsisOptional
- the is optional
-
getRequestBodyBuilder
Gets request body builder.- Returns:
- the request body builder
-
isDefaultFlatParamObject
public boolean isDefaultFlatParamObject()Is default flat param object boolean.- Returns:
- the boolean
-
getParameterBuilder
Gets parameter builder.- Returns:
- the parameter builder
-
getOptionalDelegatingMethodParameterCustomizers
public Optional<List<DelegatingMethodParameterCustomizer>> getOptionalDelegatingMethodParameterCustomizers()Gets optional delegating method parameter customizers.- Returns:
- the optional delegating method parameter customizers
-
getMethodParameterPojoExtractor
Gets method parameter pojo extractor.- Returns:
- the method parameter pojo extractor
-