Skip to content

Commit 26cde38

Browse files
committed
Parameter 2 of method indexPageTransformer in org.springdoc.webmvc.ui.SwaggerConfig required a single bean, but 2 were found. Fixes #1425
1 parent b2c3ffd commit 26cde38

File tree

5 files changed

+11
-19
lines changed

5 files changed

+11
-19
lines changed

springdoc-openapi-common/src/main/java/org/springdoc/ui/AbstractSwaggerIndexTransformer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import com.fasterxml.jackson.core.JsonProcessingException;
3232
import com.fasterxml.jackson.databind.ObjectMapper;
33+
import io.swagger.v3.core.util.Json;
3334
import org.apache.commons.lang3.StringUtils;
3435
import org.springdoc.core.Constants;
3536
import org.springdoc.core.SwaggerUiConfigParameters;
@@ -77,13 +78,12 @@ public class AbstractSwaggerIndexTransformer {
7778
* @param swaggerUiConfig the swagger ui config
7879
* @param swaggerUiOAuthProperties the swagger ui o auth properties
7980
* @param swaggerUiConfigParameters the swagger ui config parameters
80-
* @param objectMapper the object mapper
8181
*/
82-
public AbstractSwaggerIndexTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, ObjectMapper objectMapper) {
82+
public AbstractSwaggerIndexTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters) {
8383
this.swaggerUiConfig = swaggerUiConfig;
8484
this.swaggerUiOAuthProperties = swaggerUiOAuthProperties;
8585
this.swaggerUiConfigParameters = swaggerUiConfigParameters;
86-
this.objectMapper = objectMapper;
86+
this.objectMapper = Json.mapper();
8787
}
8888

8989
/**

springdoc-openapi-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerConfig.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import java.util.Optional;
2424

25-
import com.fasterxml.jackson.databind.ObjectMapper;
2625
import org.springdoc.core.SpringDocConfigProperties;
2726
import org.springdoc.core.SpringDocConfiguration;
2827
import org.springdoc.core.SwaggerUiConfigParameters;
@@ -120,14 +119,13 @@ SwaggerUiHome swaggerUiHome() {
120119
* @param swaggerUiConfig the swagger ui config
121120
* @param swaggerUiOAuthProperties the swagger ui o auth properties
122121
* @param swaggerUiConfigParameters the swagger ui config parameters
123-
* @param objectMapper the object mapper
124122
* @param swaggerWelcomeCommon the swagger welcome common
125123
* @return the swagger index transformer
126124
*/
127125
@Bean
128126
@ConditionalOnMissingBean
129-
SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, ObjectMapper objectMapper, SwaggerWelcomeCommon swaggerWelcomeCommon) {
130-
return new SwaggerIndexPageTransformer(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters, objectMapper, swaggerWelcomeCommon);
127+
SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, SwaggerWelcomeCommon swaggerWelcomeCommon) {
128+
return new SwaggerIndexPageTransformer(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters, swaggerWelcomeCommon);
131129
}
132130

133131
/**

springdoc-openapi-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerIndexPageTransformer.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
import javax.servlet.http.HttpServletRequest;
2626

27-
import com.fasterxml.jackson.databind.ObjectMapper;
2827
import org.springdoc.core.SwaggerUiConfigParameters;
2928
import org.springdoc.core.SwaggerUiConfigProperties;
3029
import org.springdoc.core.SwaggerUiOAuthProperties;
@@ -51,11 +50,10 @@ public class SwaggerIndexPageTransformer extends AbstractSwaggerIndexTransformer
5150
* @param swaggerUiConfig the swagger ui config
5251
* @param swaggerUiOAuthProperties the swagger ui o auth properties
5352
* @param swaggerUiConfigParameters the swagger ui config parameters
54-
* @param objectMapper the object mapper
5553
* @param swaggerWelcomeCommon the swagger welcome common
5654
*/
57-
public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, ObjectMapper objectMapper, SwaggerWelcomeCommon swaggerWelcomeCommon) {
58-
super(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters, objectMapper);
55+
public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, SwaggerWelcomeCommon swaggerWelcomeCommon) {
56+
super(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters);
5957
this.swaggerWelcomeCommon = swaggerWelcomeCommon;
6058
}
6159

springdoc-openapi-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerConfig.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import java.util.Optional;
2424

25-
import com.fasterxml.jackson.databind.ObjectMapper;
2625
import org.springdoc.core.SpringDocConfigProperties;
2726
import org.springdoc.core.SpringDocConfiguration;
2827
import org.springdoc.core.SwaggerUiConfigParameters;
@@ -128,14 +127,13 @@ SwaggerWebFluxConfigurer swaggerWebFluxConfigurer(SwaggerUiConfigParameters swag
128127
* @param swaggerUiConfig the swagger ui config
129128
* @param swaggerUiOAuthProperties the swagger ui o auth properties
130129
* @param swaggerUiConfigParameters the swagger ui config parameters
131-
* @param objectMapper the object mapper
132130
* @param swaggerWelcomeCommon the swagger welcome common
133131
* @return the swagger index transformer
134132
*/
135133
@Bean
136134
@ConditionalOnMissingBean
137-
SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig ,SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, ObjectMapper objectMapper, SwaggerWelcomeCommon swaggerWelcomeCommon) {
138-
return new SwaggerIndexPageTransformer(swaggerUiConfig, swaggerUiOAuthProperties,swaggerUiConfigParameters, objectMapper, swaggerWelcomeCommon);
135+
SwaggerIndexTransformer indexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig ,SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters,SwaggerWelcomeCommon swaggerWelcomeCommon) {
136+
return new SwaggerIndexPageTransformer(swaggerUiConfig, swaggerUiOAuthProperties,swaggerUiConfigParameters, swaggerWelcomeCommon);
139137
}
140138

141139
/**

springdoc-openapi-webflux-ui/src/main/java/org/springdoc/webflux/ui/SwaggerIndexPageTransformer.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
package org.springdoc.webflux.ui;
2222

23-
import com.fasterxml.jackson.databind.ObjectMapper;
2423
import org.springdoc.core.SwaggerUiConfigParameters;
2524
import org.springdoc.core.SwaggerUiConfigProperties;
2625
import org.springdoc.core.SwaggerUiOAuthProperties;
@@ -50,11 +49,10 @@ public class SwaggerIndexPageTransformer extends AbstractSwaggerIndexTransformer
5049
* @param swaggerUiConfig the swagger ui config
5150
* @param swaggerUiOAuthProperties the swagger ui o auth properties
5251
* @param swaggerUiConfigParameters the swagger ui config parameters
53-
* @param objectMapper the object mapper
5452
* @param swaggerWelcomeCommon the swagger welcome common
5553
*/
56-
public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, ObjectMapper objectMapper, SwaggerWelcomeCommon swaggerWelcomeCommon) {
57-
super(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters, objectMapper);
54+
public SwaggerIndexPageTransformer(SwaggerUiConfigProperties swaggerUiConfig, SwaggerUiOAuthProperties swaggerUiOAuthProperties, SwaggerUiConfigParameters swaggerUiConfigParameters, SwaggerWelcomeCommon swaggerWelcomeCommon) {
55+
super(swaggerUiConfig, swaggerUiOAuthProperties, swaggerUiConfigParameters);
5856
this.swaggerWelcomeCommon = swaggerWelcomeCommon;
5957
}
6058

0 commit comments

Comments
 (0)