Skip to content

Commit 6ff4c03

Browse files
committed
changes report #523.
1 parent 7de3935 commit 6ff4c03

File tree

6 files changed

+104
-17
lines changed

6 files changed

+104
-17
lines changed

springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocConfiguration.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.springdoc.core.converters.PropertyCustomizingConverter;
5353
import org.springdoc.core.converters.ResponseSupportConverter;
5454
import org.springdoc.core.converters.SchemaPropertyDeprecatingConverter;
55+
import org.springdoc.core.converters.WebFluxSupportConverter;
5556
import org.springdoc.core.customizers.ActuatorOpenApiCustomizer;
5657
import org.springdoc.core.customizers.ActuatorOperationCustomizer;
5758
import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer;
@@ -81,6 +82,7 @@
8182
import org.springdoc.core.service.RequestBodyService;
8283
import org.springdoc.core.service.SecurityService;
8384
import org.springdoc.core.utils.PropertyResolverUtils;
85+
import reactor.core.publisher.Flux;
8486

8587
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
8688
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
@@ -560,4 +562,25 @@ RepositoryRestConfigurationProvider repositoryRestConfigurationProvider(Optional
560562
ObjectMapperProvider objectMapperProvider(SpringDocConfigProperties springDocConfigProperties){
561563
return new ObjectMapperProvider(springDocConfigProperties);
562564
}
565+
566+
/**
567+
* The type Spring doc web flux support configuration.
568+
*/
569+
@ConditionalOnClass(Flux.class)
570+
static class SpringDocWebFluxSupportConfiguration {
571+
572+
/**
573+
* Web flux support converter web flux support converter.
574+
*
575+
* @param objectMapperProvider the object mapper provider
576+
* @return the web flux support converter
577+
*/
578+
@Bean
579+
@ConditionalOnMissingBean
580+
@Lazy(false)
581+
WebFluxSupportConverter webFluxSupportConverter(ObjectMapperProvider objectMapperProvider) {
582+
return new WebFluxSupportConverter(objectMapperProvider);
583+
}
584+
585+
}
563586
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
*/
2424

25-
package org.springdoc.webflux.core.converters;
25+
package org.springdoc.core.converters;
2626

2727
import java.util.Iterator;
2828

springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
import static org.springdoc.core.utils.Constants.DOT;
9898
import static org.springdoc.core.utils.Constants.OPENAPI_ARRAY_TYPE;
9999
import static org.springdoc.core.utils.Constants.OPENAPI_STRING_TYPE;
100-
import static org.springdoc.core.utils.Constants.QUERY_PARAM;
101100

102101
/**
103102
* The type Abstract request builder.

springdoc-openapi-starter-webflux-api/src/main/java/org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.springdoc.core.parsers.ReturnTypeParser;
3737
import org.springdoc.core.properties.SpringDocConfigProperties;
3838
import org.springdoc.core.providers.ActuatorProvider;
39-
import org.springdoc.core.providers.ObjectMapperProvider;
4039
import org.springdoc.core.providers.SpringDocProviders;
4140
import org.springdoc.core.providers.SpringWebProvider;
4241
import org.springdoc.core.service.AbstractRequestService;
@@ -48,7 +47,6 @@
4847
import org.springdoc.core.utils.PropertyResolverUtils;
4948
import org.springdoc.webflux.api.OpenApiActuatorResource;
5049
import org.springdoc.webflux.api.OpenApiWebfluxResource;
51-
import org.springdoc.webflux.core.converters.WebFluxSupportConverter;
5250
import org.springdoc.webflux.core.providers.ActuatorWebFluxProvider;
5351
import org.springdoc.webflux.core.providers.SpringWebFluxProvider;
5452
import org.springdoc.webflux.core.service.RequestService;
@@ -155,19 +153,6 @@ GenericResponseService responseBuilder(OperationService operationService, List<R
155153
return new GenericResponseService(operationService, returnTypeParsers, springDocConfigProperties, propertyResolverUtils);
156154
}
157155

158-
/**
159-
* Web flux support converter web flux support converter.
160-
*
161-
* @param objectMapperProvider the object mapper provider
162-
* @return the web flux support converter
163-
*/
164-
@Bean
165-
@ConditionalOnMissingBean
166-
@Lazy(false)
167-
WebFluxSupportConverter webFluxSupportConverter(ObjectMapperProvider objectMapperProvider) {
168-
return new WebFluxSupportConverter(objectMapperProvider);
169-
}
170-
171156
/**
172157
* Spring web provider spring web provider.
173158
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
*
3+
* *
4+
* * *
5+
* * * *
6+
* * * * * Copyright 2019-2022 the original author or authors.
7+
* * * * *
8+
* * * * * Licensed under the Apache License, Version 2.0 (the "License");
9+
* * * * * you may not use this file except in compliance with the License.
10+
* * * * * You may obtain a copy of the License at
11+
* * * * *
12+
* * * * * https://www.apache.org/licenses/LICENSE-2.0
13+
* * * * *
14+
* * * * * Unless required by applicable law or agreed to in writing, software
15+
* * * * * distributed under the License is distributed on an "AS IS" BASIS,
16+
* * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* * * * * See the License for the specific language governing permissions and
18+
* * * * * limitations under the License.
19+
* * * *
20+
* * *
21+
* *
22+
*
23+
*/
24+
25+
package test.org.springdoc.api.app174;
26+
27+
import reactor.core.publisher.Flux;
28+
29+
import org.springframework.web.bind.annotation.GetMapping;
30+
import org.springframework.web.bind.annotation.RestController;
31+
32+
@RestController
33+
public class HelloController {
34+
35+
@GetMapping("/test")
36+
public void printHello() {
37+
System.out.println("Hello");
38+
}
39+
40+
@GetMapping("/toto")
41+
public Flux<String> test() {
42+
return null;
43+
}
44+
}

springdoc-openapi-tests/springdoc-openapi-function-webmvc-tests/src/test/resources/results/app174.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,42 @@
1111
}
1212
],
1313
"paths": {
14+
"/toto": {
15+
"get": {
16+
"tags": [
17+
"hello-controller"
18+
],
19+
"operationId": "test",
20+
"responses": {
21+
"200": {
22+
"description": "OK",
23+
"content": {
24+
"*/*": {
25+
"schema": {
26+
"type": "array",
27+
"items": {
28+
"type": "string"
29+
}
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}
36+
},
37+
"/test": {
38+
"get": {
39+
"tags": [
40+
"hello-controller"
41+
],
42+
"operationId": "printHello",
43+
"responses": {
44+
"200": {
45+
"description": "OK"
46+
}
47+
}
48+
}
49+
},
1450
"/helloConsumer": {
1551
"post": {
1652
"description": "helloConsumer consumer",

0 commit comments

Comments
 (0)