|
| 1 | +package org.springdoc.core; |
| 2 | + |
| 3 | +import io.swagger.v3.core.converter.ModelConverter; |
| 4 | +import io.swagger.v3.oas.models.OpenAPI; |
| 5 | +import org.springdoc.core.converters.ObjectNodeConverter; |
| 6 | +import org.springframework.beans.factory.config.ConfigurableBeanFactory; |
| 7 | +import org.springframework.context.ApplicationContext; |
| 8 | +import org.springframework.context.annotation.Bean; |
| 9 | +import org.springframework.context.annotation.Configuration; |
| 10 | +import org.springframework.core.LocalVariableTableParameterNameDiscoverer; |
| 11 | + |
| 12 | +import java.util.List; |
| 13 | +import java.util.Optional; |
| 14 | + |
| 15 | +@Configuration |
| 16 | +public class SpringDocConfiguration { |
| 17 | + |
| 18 | + @Bean |
| 19 | + LocalVariableTableParameterNameDiscoverer localSpringDocParameterNameDiscoverer() { |
| 20 | + return new LocalVariableTableParameterNameDiscoverer(); |
| 21 | + } |
| 22 | + |
| 23 | + @Bean |
| 24 | + ObjectNodeConverter objectNodeConverter() { |
| 25 | + return new ObjectNodeConverter(); |
| 26 | + } |
| 27 | + |
| 28 | + @Bean |
| 29 | + IgnoredParameterAnnotationsDefault ignoredParameterAnnotationsDefault() { |
| 30 | + return new IgnoredParameterAnnotationsDefault(); |
| 31 | + } |
| 32 | + |
| 33 | + @Bean |
| 34 | + public OpenAPIBuilder openAPIBuilder(Optional<OpenAPI> openAPI, ApplicationContext context, SecurityParser securityParser) { |
| 35 | + return new OpenAPIBuilder(openAPI, context, securityParser); |
| 36 | + } |
| 37 | + |
| 38 | + @Bean |
| 39 | + public OperationBuilder operationBuilder(AbstractParameterBuilder parameterBuilder, RequestBodyBuilder requestBodyBuilder, |
| 40 | + SecurityParser securityParser, OpenAPIBuilder openAPIBuilder) { |
| 41 | + return new OperationBuilder(parameterBuilder, requestBodyBuilder, |
| 42 | + securityParser, openAPIBuilder); |
| 43 | + } |
| 44 | + |
| 45 | + @Bean |
| 46 | + public PropertyResolverUtils propertyResolverUtils(ConfigurableBeanFactory factory) { |
| 47 | + return new PropertyResolverUtils(factory); |
| 48 | + } |
| 49 | + |
| 50 | + @Bean |
| 51 | + public RequestBodyBuilder requestBodyBuilder(AbstractParameterBuilder parameterBuilder) { |
| 52 | + return new RequestBodyBuilder(parameterBuilder); |
| 53 | + } |
| 54 | + |
| 55 | + @Bean |
| 56 | + public SecurityParser securityParser(PropertyResolverUtils propertyResolverUtils) { |
| 57 | + return new SecurityParser(propertyResolverUtils); |
| 58 | + } |
| 59 | + |
| 60 | + @Bean |
| 61 | + public SpringDocAnnotationsUtils springDocAnnotationsUtils(List<ModelConverter> modelConverters) { |
| 62 | + return new SpringDocAnnotationsUtils(modelConverters); |
| 63 | + } |
| 64 | + |
| 65 | +} |
0 commit comments