File tree Expand file tree Collapse file tree
springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api/v31 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 <parent >
1212 <groupId >org.springframework.boot</groupId >
1313 <artifactId >spring-boot-starter-parent</artifactId >
14- <version >4.0.1 </version >
14+ <version >4.0.3 </version >
1515 </parent >
1616
1717 <licenses >
5656 </central-publishing-maven-plugin .version>
5757 <flatten-maven-plugin .version>1.5.0</flatten-maven-plugin .version>
5858 <swagger-api .version>2.2.43</swagger-api .version>
59- <swagger-ui .version>5.31.0 </swagger-ui .version>
59+ <swagger-ui .version>5.31.2 </swagger-ui .version>
6060 <gmavenplus-plugin .version>1.13.1</gmavenplus-plugin .version>
6161 <jjwt .version>0.9.1</jjwt .version>
6262 <therapi-runtime-javadoc .version>0.15.0</therapi-runtime-javadoc .version>
6363 <spring-cloud-function .version>5.0.0-M1</spring-cloud-function .version>
6464 <spring-security-oauth2-authorization-server .version>2.0.0-M2
6565 </spring-security-oauth2-authorization-server .version>
66- <scalar .version>0.5.8 </scalar .version>
66+ <scalar .version>0.5.55 </scalar .version>
6767 <skipPublishing >false</skipPublishing >
6868 </properties >
6969
Original file line number Diff line number Diff line change 11package test .org .springdoc .api .v31 .app194 .config ;
22
3+ import test .org .springdoc .api .v31 .NullSafeApiVersionStrategyDecorator ;
4+
5+ import org .springframework .beans .factory .ObjectProvider ;
6+ import org .springframework .beans .factory .SmartInitializingSingleton ;
7+ import org .springframework .context .annotation .Bean ;
38import org .springframework .context .annotation .Configuration ;
9+ import org .springframework .web .reactive .accept .ApiVersionStrategy ;
410import org .springframework .web .reactive .config .ApiVersionConfigurer ;
511import org .springframework .web .reactive .config .WebFluxConfigurer ;
12+ import org .springframework .web .reactive .handler .AbstractHandlerMapping ;
613
714@ Configuration
815public class WebConfig implements WebFluxConfigurer {
@@ -18,4 +25,15 @@ public void configureApiVersioning(ApiVersionConfigurer configurer) {
1825 .setVersionParser (new ApiVersionParser ());
1926 }
2027
28+ @ Bean
29+ SmartInitializingSingleton nullSafeApiVersionStrategyInitializer (
30+ ObjectProvider <AbstractHandlerMapping > handlerMappings ) {
31+ return () -> handlerMappings .forEach (mapping -> {
32+ ApiVersionStrategy strategy = mapping .getApiVersionStrategy ();
33+ if (strategy != null && !(strategy instanceof NullSafeApiVersionStrategyDecorator )) {
34+ mapping .setApiVersionStrategy (new NullSafeApiVersionStrategyDecorator (strategy ));
35+ }
36+ });
37+ }
38+
2139}
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public class WebConfiguration implements WebFluxConfigurer {
1212
1313 public void configureApiVersioning (ApiVersionConfigurer configurer ) {
1414 configurer .setVersionRequired (false );
15+ configurer .setDefaultVersion ("1.0" );
1516 configurer .useQueryParam ("API-Version" );
1617 }
17- }
18+ }
You can’t perform that action at this time.
0 commit comments