Class AbstractRequestService


  • public abstract class AbstractRequestService
    extends Object
    The type Abstract request builder.
    Author:
    bnasslahsen
    • Constructor Detail

      • AbstractRequestService

        protected AbstractRequestService​(GenericParameterService parameterBuilder,
                                         RequestBodyService requestBodyService,
                                         OperationService operationService,
                                         Optional<List<ParameterCustomizer>> parameterCustomizers,
                                         org.springframework.core.LocalVariableTableParameterNameDiscoverer localSpringDocParameterNameDiscoverer)
        Instantiates a new Abstract request builder.
        Parameters:
        parameterBuilder - the parameter builder
        requestBodyService - the request body builder
        operationService - the operation builder
        parameterCustomizers - the parameter customizers
        localSpringDocParameterNameDiscoverer - the local spring doc parameter name discoverer
    • Method Detail

      • addRequestWrapperToIgnore

        public static void addRequestWrapperToIgnore​(Class<?>... classes)
        Add request wrapper to ignore.
        Parameters:
        classes - the classes
      • removeRequestWrapperToIgnore

        public static void removeRequestWrapperToIgnore​(Class<?>... classes)
        Remove request wrapper to ignore.
        Parameters:
        classes - the classes
      • isRequestTypeToIgnore

        public static boolean isRequestTypeToIgnore​(Class<?> rawClass)
        Is request type to ignore boolean.
        Parameters:
        rawClass - the raw class
        Returns:
        the boolean
      • 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 method
        requestMethod - the request method
        operation - the operation
        methodAttributes - the method attributes
        openAPI - the open api
        Returns:
        the operation
      • getHeaders

        public static Collection<io.swagger.v3.oas.models.parameters.Parameter> getHeaders​(MethodAttributes methodAttributes,
                                                                                           Map<String,​io.swagger.v3.oas.models.parameters.Parameter> map)
        Gets headers.
        Parameters:
        methodAttributes - the method attributes
        map - the map
        Returns:
        the headers
      • 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 parameter
        parameterInfo - the parameter info
        operationParameters - 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)
        Is valid parameter boolean.
        Parameters:
        parameter - the parameter
        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,
                                                                         com.fasterxml.jackson.annotation.JsonView jsonView)
        Build params parameter.
        Parameters:
        parameterInfo - the parameter info
        components - the components
        requestMethod - the request method
        jsonView - the json view
        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 info
        components - the components
        jsonView - the json view
        Returns:
        the parameter
      • applyBeanValidatorAnnotations

        public void applyBeanValidatorAnnotations​(io.swagger.v3.oas.models.parameters.Parameter parameter,
                                                  List<Annotation> annotations)
        Apply bean validator annotations.
        Parameters:
        parameter - the parameter
        annotations - the annotations
      • 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 body
        annotations - the annotations
        isOptional - the is optional
      • getRequestBodyBuilder

        public RequestBodyService getRequestBodyBuilder()
        Gets request body builder.
        Returns:
        the request body builder