Search in sources :

Example 1 with MethodAttributes

use of org.springdoc.core.MethodAttributes in project springdoc-openapi by springdoc.

the class AbstractOpenApiResource method calculatePath.

/**
 * Calculate path.
 *
 * @param handlerMethod the handler method
 * @param routerOperation the router operation
 * @param locale the locale
 */
protected void calculatePath(HandlerMethod handlerMethod, RouterOperation routerOperation, Locale locale) {
    String operationPath = routerOperation.getPath();
    Set<RequestMethod> requestMethods = new HashSet<>(Arrays.asList(routerOperation.getMethods()));
    io.swagger.v3.oas.annotations.Operation apiOperation = routerOperation.getOperation();
    String[] methodConsumes = routerOperation.getConsumes();
    String[] methodProduces = routerOperation.getProduces();
    String[] headers = routerOperation.getHeaders();
    Map<String, String> queryParams = routerOperation.getQueryParams();
    OpenAPI openAPI = openAPIService.getCalculatedOpenAPI();
    Components components = openAPI.getComponents();
    Paths paths = openAPI.getPaths();
    Map<HttpMethod, Operation> operationMap = null;
    if (paths.containsKey(operationPath)) {
        PathItem pathItem = paths.get(operationPath);
        operationMap = pathItem.readOperationsMap();
    }
    JavadocProvider javadocProvider = operationParser.getJavadocProvider();
    for (RequestMethod requestMethod : requestMethods) {
        Operation existingOperation = getExistingOperation(operationMap, requestMethod);
        Method method = handlerMethod.getMethod();
        // skip hidden operations
        if (operationParser.isHidden(method))
            continue;
        RequestMapping reqMappingClass = AnnotatedElementUtils.findMergedAnnotation(handlerMethod.getBeanType(), RequestMapping.class);
        MethodAttributes methodAttributes = new MethodAttributes(springDocConfigProperties.getDefaultConsumesMediaType(), springDocConfigProperties.getDefaultProducesMediaType(), methodConsumes, methodProduces, headers, locale);
        methodAttributes.setMethodOverloaded(existingOperation != null);
        // Use the javadoc return if present
        if (javadocProvider != null) {
            methodAttributes.setJavadocReturn(javadocProvider.getMethodJavadocReturn(handlerMethod.getMethod()));
        }
        if (reqMappingClass != null) {
            methodAttributes.setClassConsumes(reqMappingClass.consumes());
            methodAttributes.setClassProduces(reqMappingClass.produces());
        }
        methodAttributes.calculateHeadersForClass(method.getDeclaringClass());
        methodAttributes.calculateConsumesProduces(method);
        Operation operation = (existingOperation != null) ? existingOperation : new Operation();
        if (isDeprecated(method))
            operation.setDeprecated(true);
        // Add documentation from operation annotation
        if (apiOperation == null || StringUtils.isBlank(apiOperation.operationId()))
            apiOperation = AnnotatedElementUtils.findMergedAnnotation(method, io.swagger.v3.oas.annotations.Operation.class);
        calculateJsonView(apiOperation, methodAttributes, method);
        if (apiOperation != null)
            openAPI = operationParser.parse(apiOperation, operation, openAPI, methodAttributes);
        fillParametersList(operation, queryParams, methodAttributes);
        // compute tags
        operation = openAPIService.buildTags(handlerMethod, operation, openAPI, locale);
        io.swagger.v3.oas.annotations.parameters.RequestBody requestBodyDoc = AnnotatedElementUtils.findMergedAnnotation(method, io.swagger.v3.oas.annotations.parameters.RequestBody.class);
        // RequestBody in Operation
        requestBuilder.getRequestBodyBuilder().buildRequestBodyFromDoc(requestBodyDoc, methodAttributes, components, methodAttributes.getJsonViewAnnotationForRequestBody()).ifPresent(operation::setRequestBody);
        // requests
        operation = requestBuilder.build(handlerMethod, requestMethod, operation, methodAttributes, openAPI);
        // responses
        ApiResponses apiResponses = responseBuilder.build(components, handlerMethod, operation, methodAttributes);
        operation.setResponses(apiResponses);
        // get javadoc method description
        if (javadocProvider != null) {
            String description = javadocProvider.getMethodJavadocDescription(handlerMethod.getMethod());
            if (!StringUtils.isEmpty(description) && StringUtils.isEmpty(operation.getDescription()))
                operation.setDescription(description);
        }
        Set<io.swagger.v3.oas.annotations.callbacks.Callback> apiCallbacks = AnnotatedElementUtils.findMergedRepeatableAnnotations(method, io.swagger.v3.oas.annotations.callbacks.Callback.class);
        // callbacks
        buildCallbacks(openAPI, methodAttributes, operation, apiCallbacks);
        // allow for customisation
        operation = customiseOperation(operation, handlerMethod);
        PathItem pathItemObject = buildPathItem(requestMethod, operation, operationPath, paths);
        paths.addPathItem(operationPath, pathItemObject);
    }
}
Also used : RequestMethod(org.springframework.web.bind.annotation.RequestMethod) JavadocProvider(org.springdoc.core.providers.JavadocProvider) Operation(io.swagger.v3.oas.models.Operation) RouterOperation(org.springdoc.core.fn.RouterOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Components(io.swagger.v3.oas.models.Components) PathItem(io.swagger.v3.oas.models.PathItem) Paths(io.swagger.v3.oas.models.Paths) ApiResponses(io.swagger.v3.oas.models.responses.ApiResponses) HashSet(java.util.HashSet) HandlerMethod(org.springframework.web.method.HandlerMethod) Method(java.lang.reflect.Method) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) HttpMethod(io.swagger.v3.oas.models.PathItem.HttpMethod) Callback(io.swagger.v3.oas.annotations.callbacks.Callback) OpenAPI(io.swagger.v3.oas.models.OpenAPI) HttpMethod(io.swagger.v3.oas.models.PathItem.HttpMethod) MethodAttributes(org.springdoc.core.MethodAttributes)

Example 2 with MethodAttributes

use of org.springdoc.core.MethodAttributes in project springdoc-openapi by springdoc.

the class DataRestRouterOperationService method buildRouterOperation.

/**
 * Build router operation.
 *
 * @param routerOperationList the router operation list
 * @param dataRestRepository the repository data rest
 * @param openAPI the open api
 * @param methodResourceMapping the method resource mapping
 * @param handlerMethod the handler method
 * @param requestMethod the request method
 * @param resourceMetadata the resource metadata
 * @param operationPath the operation path
 * @param controllerType the controller type
 */
private void buildRouterOperation(List<RouterOperation> routerOperationList, DataRestRepository dataRestRepository, OpenAPI openAPI, MethodResourceMapping methodResourceMapping, HandlerMethod handlerMethod, RequestMethod requestMethod, ResourceMetadata resourceMetadata, String operationPath, ControllerType controllerType) {
    RouterOperation routerOperation = new RouterOperation(operationPath, new RequestMethod[] { requestMethod });
    MethodAttributes methodAttributes = new MethodAttributes(springDocConfigProperties.getDefaultConsumesMediaType(), springDocConfigProperties.getDefaultProducesMediaType(), dataRestRepository.getLocale());
    methodAttributes.calculateConsumesProduces(handlerMethod.getMethod());
    routerOperation.setConsumes(methodAttributes.getMethodConsumes());
    routerOperation.setProduces(methodAttributes.getMethodProduces());
    Operation operation = dataRestOperationService.buildOperation(handlerMethod, dataRestRepository, openAPI, requestMethod, operationPath, methodAttributes, resourceMetadata, methodResourceMapping, controllerType);
    routerOperation.setOperationModel(operation);
    routerOperationList.add(routerOperation);
}
Also used : RouterOperation(org.springdoc.core.fn.RouterOperation) Operation(io.swagger.v3.oas.models.Operation) RouterOperation(org.springdoc.core.fn.RouterOperation) MethodAttributes(org.springdoc.core.MethodAttributes)

Example 3 with MethodAttributes

use of org.springdoc.core.MethodAttributes in project springdoc-openapi by springdoc.

the class DataRestRouterOperationService method isSearchControllerPresent.

/**
 * Is search controller present boolean.
 *
 * @param requestMappingInfo the request mapping info
 * @param handlerMethod the handler method
 * @param requestMethod the request method
 * @param locale the locale
 * @return the boolean
 */
private boolean isSearchControllerPresent(RequestMappingInfo requestMappingInfo, HandlerMethod handlerMethod, RequestMethod requestMethod, Locale locale) {
    if (!UNDOCUMENTED_REQUEST_METHODS.contains(requestMethod)) {
        Set<String> patterns = getActivePatterns(requestMappingInfo);
        if (!CollectionUtils.isEmpty(patterns)) {
            Map<String, String> regexMap = new LinkedHashMap<>();
            String operationPath;
            for (String pattern : patterns) {
                operationPath = PathUtils.parsePath(pattern, regexMap);
                if (andCheck(operationPath.contains(REPOSITORY_PATH), operationPath.contains(SEARCH_PATH))) {
                    MethodAttributes methodAttributes = new MethodAttributes(springDocConfigProperties.getDefaultConsumesMediaType(), springDocConfigProperties.getDefaultProducesMediaType(), locale);
                    methodAttributes.calculateConsumesProduces(handlerMethod.getMethod());
                    if (springDocConfigProperties.getDefaultProducesMediaType().equals(methodAttributes.getMethodProduces()[0]))
                        return true;
                }
            }
        }
    }
    return false;
}
Also used : MethodAttributes(org.springdoc.core.MethodAttributes) LinkedHashMap(java.util.LinkedHashMap)

Example 4 with MethodAttributes

use of org.springdoc.core.MethodAttributes in project springdoc-openapi by springdoc.

the class AbstractOpenApiResource method calculatePath.

/**
 * Calculate path.
 *
 * @param routerOperation the router operation
 * @param locale the locale
 */
protected void calculatePath(RouterOperation routerOperation, Locale locale) {
    String operationPath = routerOperation.getPath();
    io.swagger.v3.oas.annotations.Operation apiOperation = routerOperation.getOperation();
    String[] methodConsumes = routerOperation.getConsumes();
    String[] methodProduces = routerOperation.getProduces();
    String[] headers = routerOperation.getHeaders();
    Map<String, String> queryParams = routerOperation.getQueryParams();
    OpenAPI openAPI = openAPIService.getCalculatedOpenAPI();
    Paths paths = openAPI.getPaths();
    Map<HttpMethod, Operation> operationMap = null;
    if (paths.containsKey(operationPath)) {
        PathItem pathItem = paths.get(operationPath);
        operationMap = pathItem.readOperationsMap();
    }
    for (RequestMethod requestMethod : routerOperation.getMethods()) {
        Operation existingOperation = getExistingOperation(operationMap, requestMethod);
        MethodAttributes methodAttributes = new MethodAttributes(springDocConfigProperties.getDefaultConsumesMediaType(), springDocConfigProperties.getDefaultProducesMediaType(), methodConsumes, methodProduces, headers, locale);
        methodAttributes.setMethodOverloaded(existingOperation != null);
        Operation operation = getOperation(routerOperation, existingOperation);
        if (apiOperation != null)
            openAPI = operationParser.parse(apiOperation, operation, openAPI, methodAttributes);
        String operationId = operationParser.getOperationId(operation.getOperationId(), openAPI);
        operation.setOperationId(operationId);
        fillParametersList(operation, queryParams, methodAttributes);
        if (!CollectionUtils.isEmpty(operation.getParameters()))
            operation.getParameters().stream().filter(parameter -> StringUtils.isEmpty(parameter.get$ref())).forEach(parameter -> {
                if (parameter.getSchema() == null)
                    parameter.setSchema(new StringSchema());
                if (parameter.getIn() == null)
                    parameter.setIn(ParameterIn.QUERY.toString());
            });
        PathItem pathItemObject = buildPathItem(requestMethod, operation, operationPath, paths);
        paths.addPathItem(operationPath, pathItemObject);
    }
}
Also used : RouterOperations(org.springdoc.core.annotations.RouterOperations) Arrays(java.util.Arrays) JsonView(com.fasterxml.jackson.annotation.JsonView) URLDecoder(java.net.URLDecoder) AopUtils(org.springframework.aop.support.AopUtils) Yaml(io.swagger.v3.core.util.Yaml) URISyntaxException(java.net.URISyntaxException) Parameter(io.swagger.v3.oas.models.parameters.Parameter) LoggerFactory(org.slf4j.LoggerFactory) Operation(io.swagger.v3.oas.models.Operation) DOT(org.springdoc.core.Constants.DOT) StringUtils(org.apache.commons.lang3.StringUtils) OpenApiLocaleCustomizer(org.springdoc.core.customizers.OpenApiLocaleCustomizer) HandlerMethod(org.springframework.web.method.HandlerMethod) JavadocProvider(org.springdoc.core.providers.JavadocProvider) OpenApiMethodFilter(org.springdoc.core.filters.OpenApiMethodFilter) SchemaPropertyDeprecatingConverter.isDeprecated(org.springdoc.core.converters.SchemaPropertyDeprecatingConverter.isDeprecated) Locale(java.util.Locale) Duration(java.time.Duration) Map(java.util.Map) OperationService(org.springdoc.core.OperationService) CloudFunctionProvider(org.springdoc.core.providers.CloudFunctionProvider) URI(java.net.URI) RouterOperation(org.springdoc.core.fn.RouterOperation) AntPathMatcher(org.springframework.util.AntPathMatcher) TypeReference(com.fasterxml.jackson.core.type.TypeReference) ACTUATOR_DEFAULT_GROUP(org.springdoc.core.Constants.ACTUATOR_DEFAULT_GROUP) Method(java.lang.reflect.Method) SortedOpenAPIMixin(org.springdoc.api.mixins.SortedOpenAPIMixin) MethodAttributes(org.springdoc.core.MethodAttributes) Hidden(io.swagger.v3.oas.annotations.Hidden) Collection(java.util.Collection) AnnotationUtils(org.springframework.core.annotation.AnnotationUtils) Set(java.util.Set) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) Paths(io.swagger.v3.oas.models.Paths) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) DEFAULT_PATH_SEPARATOR(org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR) Objects(java.util.Objects) List(java.util.List) HttpMethod(io.swagger.v3.oas.models.PathItem.HttpMethod) Server(io.swagger.v3.oas.models.servers.Server) StringSchema(io.swagger.v3.oas.models.media.StringSchema) Environment(org.springframework.core.env.Environment) CollectionUtils(org.springframework.util.CollectionUtils) Optional(java.util.Optional) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Feature(com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature) OperationCustomizer(org.springdoc.core.customizers.OperationCustomizer) AnnotatedElementUtils(org.springframework.core.annotation.AnnotatedElementUtils) ActuatorProvider(org.springdoc.core.providers.ActuatorProvider) Json(io.swagger.v3.core.util.Json) GenericResponseService(org.springdoc.core.GenericResponseService) AbstractRouterFunctionVisitor(org.springdoc.core.fn.AbstractRouterFunctionVisitor) OPERATION_ATTRIBUTE(org.springdoc.core.Constants.OPERATION_ATTRIBUTE) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ArrayUtils(org.apache.commons.lang3.ArrayUtils) SpecFilter(io.swagger.v3.core.filter.SpecFilter) ParameterIn(io.swagger.v3.oas.annotations.enums.ParameterIn) ArrayList(java.util.ArrayList) LINKS_SCHEMA_CUSTOMISER(org.springdoc.core.Constants.LINKS_SCHEMA_CUSTOMISER) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) RequestBody(org.springframework.web.bind.annotation.RequestBody) MapperFeature(com.fasterxml.jackson.databind.MapperFeature) OpenAPI(io.swagger.v3.oas.models.OpenAPI) SortedSchemaMixin(org.springdoc.api.mixins.SortedSchemaMixin) YAMLFactory(com.fasterxml.jackson.dataformat.yaml.YAMLFactory) OpenAPIService(org.springdoc.core.OpenAPIService) AbstractRequestService(org.springdoc.core.AbstractRequestService) Schema(io.swagger.v3.oas.models.media.Schema) SpringDocProviders(org.springdoc.core.SpringDocProviders) OpenApiCustomiser(org.springdoc.core.customizers.OpenApiCustomiser) GenericParameterService(org.springdoc.core.GenericParameterService) ApiResponses(io.swagger.v3.oas.models.responses.ApiResponses) SpringDocConfigProperties(org.springdoc.core.SpringDocConfigProperties) Logger(org.slf4j.Logger) RouterFunctionData(org.springdoc.core.fn.RouterFunctionData) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) PathItem(io.swagger.v3.oas.models.PathItem) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) Callback(io.swagger.v3.oas.annotations.callbacks.Callback) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) ApplicationContext(org.springframework.context.ApplicationContext) GroupConfig(org.springdoc.core.SpringDocConfigProperties.GroupConfig) ReflectionUtils(io.swagger.v3.core.util.ReflectionUtils) ObjectFactory(org.springframework.beans.factory.ObjectFactory) Components(io.swagger.v3.oas.models.Components) SerializationFeature(com.fasterxml.jackson.databind.SerializationFeature) SPRING_MVC_SERVLET_PATH(org.springdoc.core.Constants.SPRING_MVC_SERVLET_PATH) Collections(java.util.Collections) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) Operation(io.swagger.v3.oas.models.Operation) RouterOperation(org.springdoc.core.fn.RouterOperation) PathItem(io.swagger.v3.oas.models.PathItem) StringSchema(io.swagger.v3.oas.models.media.StringSchema) Paths(io.swagger.v3.oas.models.Paths) OpenAPI(io.swagger.v3.oas.models.OpenAPI) HttpMethod(io.swagger.v3.oas.models.PathItem.HttpMethod) MethodAttributes(org.springdoc.core.MethodAttributes)

Example 5 with MethodAttributes

use of org.springdoc.core.MethodAttributes in project springdoc-openapi by springdoc.

the class AbstractOpenApiResource method calculateJsonView.

/**
 * Calculate json view.
 *
 * @param apiOperation the api operation
 * @param methodAttributes the method attributes
 * @param method the method
 */
private void calculateJsonView(io.swagger.v3.oas.annotations.Operation apiOperation, MethodAttributes methodAttributes, Method method) {
    JsonView jsonViewAnnotation;
    JsonView jsonViewAnnotationForRequestBody;
    if (apiOperation != null && apiOperation.ignoreJsonView()) {
        jsonViewAnnotation = null;
        jsonViewAnnotationForRequestBody = null;
    } else {
        jsonViewAnnotation = AnnotatedElementUtils.findMergedAnnotation(method, JsonView.class);
        /*
			 * If one and only one exists, use the @JsonView annotation from the method
			 * parameter annotated with @RequestBody. Otherwise fall back to the @JsonView
			 * annotation for the method itself.
			 */
        jsonViewAnnotationForRequestBody = (JsonView) Arrays.stream(ReflectionUtils.getParameterAnnotations(method)).filter(arr -> Arrays.stream(arr).anyMatch(annotation -> (annotation.annotationType().equals(io.swagger.v3.oas.annotations.parameters.RequestBody.class) || annotation.annotationType().equals(RequestBody.class)))).flatMap(Arrays::stream).filter(annotation -> annotation.annotationType().equals(JsonView.class)).reduce((a, b) -> null).orElse(jsonViewAnnotation);
    }
    methodAttributes.setJsonViewAnnotation(jsonViewAnnotation);
    methodAttributes.setJsonViewAnnotationForRequestBody(jsonViewAnnotationForRequestBody);
}
Also used : RouterOperations(org.springdoc.core.annotations.RouterOperations) Arrays(java.util.Arrays) JsonView(com.fasterxml.jackson.annotation.JsonView) URLDecoder(java.net.URLDecoder) AopUtils(org.springframework.aop.support.AopUtils) Yaml(io.swagger.v3.core.util.Yaml) URISyntaxException(java.net.URISyntaxException) Parameter(io.swagger.v3.oas.models.parameters.Parameter) LoggerFactory(org.slf4j.LoggerFactory) Operation(io.swagger.v3.oas.models.Operation) DOT(org.springdoc.core.Constants.DOT) StringUtils(org.apache.commons.lang3.StringUtils) OpenApiLocaleCustomizer(org.springdoc.core.customizers.OpenApiLocaleCustomizer) HandlerMethod(org.springframework.web.method.HandlerMethod) JavadocProvider(org.springdoc.core.providers.JavadocProvider) OpenApiMethodFilter(org.springdoc.core.filters.OpenApiMethodFilter) SchemaPropertyDeprecatingConverter.isDeprecated(org.springdoc.core.converters.SchemaPropertyDeprecatingConverter.isDeprecated) Locale(java.util.Locale) Duration(java.time.Duration) Map(java.util.Map) OperationService(org.springdoc.core.OperationService) CloudFunctionProvider(org.springdoc.core.providers.CloudFunctionProvider) URI(java.net.URI) RouterOperation(org.springdoc.core.fn.RouterOperation) AntPathMatcher(org.springframework.util.AntPathMatcher) TypeReference(com.fasterxml.jackson.core.type.TypeReference) ACTUATOR_DEFAULT_GROUP(org.springdoc.core.Constants.ACTUATOR_DEFAULT_GROUP) Method(java.lang.reflect.Method) SortedOpenAPIMixin(org.springdoc.api.mixins.SortedOpenAPIMixin) MethodAttributes(org.springdoc.core.MethodAttributes) Hidden(io.swagger.v3.oas.annotations.Hidden) Collection(java.util.Collection) AnnotationUtils(org.springframework.core.annotation.AnnotationUtils) Set(java.util.Set) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) Paths(io.swagger.v3.oas.models.Paths) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) DEFAULT_PATH_SEPARATOR(org.springframework.util.AntPathMatcher.DEFAULT_PATH_SEPARATOR) Objects(java.util.Objects) List(java.util.List) HttpMethod(io.swagger.v3.oas.models.PathItem.HttpMethod) Server(io.swagger.v3.oas.models.servers.Server) StringSchema(io.swagger.v3.oas.models.media.StringSchema) Environment(org.springframework.core.env.Environment) CollectionUtils(org.springframework.util.CollectionUtils) Optional(java.util.Optional) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Feature(com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature) OperationCustomizer(org.springdoc.core.customizers.OperationCustomizer) AnnotatedElementUtils(org.springframework.core.annotation.AnnotatedElementUtils) ActuatorProvider(org.springdoc.core.providers.ActuatorProvider) Json(io.swagger.v3.core.util.Json) GenericResponseService(org.springdoc.core.GenericResponseService) AbstractRouterFunctionVisitor(org.springdoc.core.fn.AbstractRouterFunctionVisitor) OPERATION_ATTRIBUTE(org.springdoc.core.Constants.OPERATION_ATTRIBUTE) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ArrayUtils(org.apache.commons.lang3.ArrayUtils) SpecFilter(io.swagger.v3.core.filter.SpecFilter) ParameterIn(io.swagger.v3.oas.annotations.enums.ParameterIn) ArrayList(java.util.ArrayList) LINKS_SCHEMA_CUSTOMISER(org.springdoc.core.Constants.LINKS_SCHEMA_CUSTOMISER) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) RequestBody(org.springframework.web.bind.annotation.RequestBody) MapperFeature(com.fasterxml.jackson.databind.MapperFeature) OpenAPI(io.swagger.v3.oas.models.OpenAPI) SortedSchemaMixin(org.springdoc.api.mixins.SortedSchemaMixin) YAMLFactory(com.fasterxml.jackson.dataformat.yaml.YAMLFactory) OpenAPIService(org.springdoc.core.OpenAPIService) AbstractRequestService(org.springdoc.core.AbstractRequestService) Schema(io.swagger.v3.oas.models.media.Schema) SpringDocProviders(org.springdoc.core.SpringDocProviders) OpenApiCustomiser(org.springdoc.core.customizers.OpenApiCustomiser) GenericParameterService(org.springdoc.core.GenericParameterService) ApiResponses(io.swagger.v3.oas.models.responses.ApiResponses) SpringDocConfigProperties(org.springdoc.core.SpringDocConfigProperties) Logger(org.slf4j.Logger) RouterFunctionData(org.springdoc.core.fn.RouterFunctionData) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) PathItem(io.swagger.v3.oas.models.PathItem) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) Callback(io.swagger.v3.oas.annotations.callbacks.Callback) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) ApplicationContext(org.springframework.context.ApplicationContext) GroupConfig(org.springdoc.core.SpringDocConfigProperties.GroupConfig) ReflectionUtils(io.swagger.v3.core.util.ReflectionUtils) ObjectFactory(org.springframework.beans.factory.ObjectFactory) Components(io.swagger.v3.oas.models.Components) SerializationFeature(com.fasterxml.jackson.databind.SerializationFeature) SPRING_MVC_SERVLET_PATH(org.springdoc.core.Constants.SPRING_MVC_SERVLET_PATH) Collections(java.util.Collections) JsonView(com.fasterxml.jackson.annotation.JsonView)

Aggregations

MethodAttributes (org.springdoc.core.MethodAttributes)5 Operation (io.swagger.v3.oas.models.Operation)4 RouterOperation (org.springdoc.core.fn.RouterOperation)4 Callback (io.swagger.v3.oas.annotations.callbacks.Callback)3 Components (io.swagger.v3.oas.models.Components)3 OpenAPI (io.swagger.v3.oas.models.OpenAPI)3 PathItem (io.swagger.v3.oas.models.PathItem)3 HttpMethod (io.swagger.v3.oas.models.PathItem.HttpMethod)3 Paths (io.swagger.v3.oas.models.Paths)3 ApiResponses (io.swagger.v3.oas.models.responses.ApiResponses)3 Method (java.lang.reflect.Method)3 LinkedHashMap (java.util.LinkedHashMap)3 JsonView (com.fasterxml.jackson.annotation.JsonView)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)2 MapperFeature (com.fasterxml.jackson.databind.MapperFeature)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 SerializationFeature (com.fasterxml.jackson.databind.SerializationFeature)2 YAMLFactory (com.fasterxml.jackson.dataformat.yaml.YAMLFactory)2 Feature (com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature)2