Class GenericResponseService

java.lang.Object
org.springdoc.core.service.GenericResponseService

public class GenericResponseService extends Object
The type Generic response builder.
Author:
bnasslahsen
  • Constructor Details

    • GenericResponseService

      public GenericResponseService(OperationService operationService, List<ReturnTypeParser> returnTypeParsers, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils)
      Instantiates a new Generic response builder.
      Parameters:
      operationService - the operation builder
      returnTypeParsers - the return type parsers
      springDocConfigProperties - the spring doc config properties
      propertyResolverUtils - the property resolver utils
  • Method Details

    • buildContentFromDoc

      public static void buildContentFromDoc(io.swagger.v3.oas.models.Components components, io.swagger.v3.oas.models.responses.ApiResponses apiResponsesOp, MethodAttributes methodAttributes, io.swagger.v3.oas.annotations.responses.ApiResponse apiResponseAnnotations, io.swagger.v3.oas.models.responses.ApiResponse apiResponse, boolean openapi31)
      Build content from doc.
      Parameters:
      components - the components
      apiResponsesOp - the api responses op
      methodAttributes - the method attributes
      apiResponseAnnotations - the api response annotations
      apiResponse - the api response
      openapi31 - the openapi 31
    • setDescription

      public static void setDescription(String httpCode, io.swagger.v3.oas.models.responses.ApiResponse apiResponse)
      Sets description.
      Parameters:
      httpCode - the http code
      apiResponse - the api response
    • setResponseEntityExceptionHandlerClass

      public static void setResponseEntityExceptionHandlerClass(Class<?> responseEntityExceptionHandlerClass)
      Sets response entity exception handler class.
      Parameters:
      responseEntityExceptionHandlerClass - the response entity exception handler class
    • build

      public io.swagger.v3.oas.models.responses.ApiResponses build(io.swagger.v3.oas.models.Components components, org.springframework.web.method.HandlerMethod handlerMethod, io.swagger.v3.oas.models.Operation operation, MethodAttributes methodAttributes)
      Build api responses.
      Parameters:
      components - the components
      handlerMethod - the handler method
      operation - the operation
      methodAttributes - the method attributes
      Returns:
      the api responses
    • buildGenericResponse

      public void buildGenericResponse(io.swagger.v3.oas.models.Components components, Map<String,Object> findControllerAdvice, Locale locale)
      Build generic response.
      Parameters:
      components - the components
      findControllerAdvice - the find controller advice
      locale - the locale
    • getApiResponses

      public Set<io.swagger.v3.oas.annotations.responses.ApiResponse> getApiResponses(Method method)
      Gets api responses.
      Parameters:
      method - the method
      Returns:
      the api responses
    • buildContent

      public io.swagger.v3.oas.models.media.Content buildContent(io.swagger.v3.oas.models.Components components, Annotation[] annotations, String[] methodProduces, com.fasterxml.jackson.annotation.JsonView jsonView, Type returnType)
      Build content content.
      Parameters:
      components - the components
      annotations - the annotations
      methodProduces - the method produces
      jsonView - the json view
      returnType - the return type
      Returns:
      the content
    • evaluateResponseStatus

      public String evaluateResponseStatus(Method method, Class<?> beanType, boolean isGeneric)
      Evaluate response status string.
      Parameters:
      method - the method
      beanType - the bean type
      isGeneric - the is generic
      Returns:
      the string