public class GenericResponseService extends Object
Constructor and Description |
---|
GenericResponseService(OperationService operationService,
List<ReturnTypeParser> returnTypeParsers,
SpringDocConfigProperties springDocConfigProperties,
PropertyResolverUtils propertyResolverUtils)
Instantiates a new Generic response builder.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
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)
Build content from doc.
|
void |
buildGenericResponse(io.swagger.v3.oas.models.Components components,
Map<String,Object> findControllerAdvice)
Build generic response.
|
String |
evaluateResponseStatus(Method method,
Class<?> beanType,
boolean isGeneric)
Evaluate response status string.
|
Set<io.swagger.v3.oas.annotations.responses.ApiResponse> |
getApiResponses(Method method)
Gets api responses.
|
static void |
setDescription(String httpCode,
io.swagger.v3.oas.models.responses.ApiResponse apiResponse)
Sets description.
|
public GenericResponseService(OperationService operationService, List<ReturnTypeParser> returnTypeParsers, SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils)
operationService
- the operation builderreturnTypeParsers
- the return type parsersspringDocConfigProperties
- the spring doc config propertiespropertyResolverUtils
- the property resolver utilspublic 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)
components
- the componentshandlerMethod
- the handler methodoperation
- the operationmethodAttributes
- the method attributespublic void buildGenericResponse(io.swagger.v3.oas.models.Components components, Map<String,Object> findControllerAdvice)
components
- the componentsfindControllerAdvice
- the find controller advicepublic 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)
components
- the componentsapiResponsesOp
- the api responses opmethodAttributes
- the method attributesapiResponseAnnotations
- the api response annotationsapiResponse
- the api responsepublic Set<io.swagger.v3.oas.annotations.responses.ApiResponse> getApiResponses(Method method)
method
- the methodpublic 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)
components
- the componentsannotations
- the annotationsmethodProduces
- the method producesjsonView
- the json viewreturnType
- the return typepublic static void setDescription(String httpCode, io.swagger.v3.oas.models.responses.ApiResponse apiResponse)
httpCode
- the http codeapiResponse
- the api responseCopyright © 2021. All rights reserved.