Skip to content

Commit 368df6b

Browse files
committed
Compatibility with Spring Boot 3.0 M3 / Spring Framework 6.0 M4. Fixes #1671.
1 parent ffc8b0d commit 368df6b

File tree

19 files changed

+475
-220
lines changed

19 files changed

+475
-220
lines changed

pom.xml

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
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+
125
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
226
<modelVersion>4.0.0</modelVersion>
327
<groupId>org.springdoc</groupId>
@@ -11,7 +35,7 @@
1135
<parent>
1236
<groupId>org.springframework.boot</groupId>
1337
<artifactId>spring-boot-starter-parent</artifactId>
14-
<version>3.0.0-M2</version>
38+
<version>3.0.0-M3</version>
1539
</parent>
1640

1741
<licenses>
@@ -62,14 +86,14 @@
6286
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
6387
<nexus-staging-maven-plugin>1.6.8</nexus-staging-maven-plugin>
6488
<swagger-api.version>2.2.0</swagger-api.version>
65-
<swagger-ui.version>4.10.3</swagger-ui.version>
66-
<classgraph.version>4.8.143</classgraph.version>
89+
<swagger-ui.version>4.11.1</swagger-ui.version>
90+
<classgraph.version>4.8.147</classgraph.version>
6791
<webjars-locator-core.version>0.50</webjars-locator-core.version>
6892
<gmavenplus-plugin.version>1.13.1</gmavenplus-plugin.version>
6993
<jaxb-impl.version>2.1</jaxb-impl.version>
7094
<javax.jws-api.version>1.1</javax.jws-api.version>
7195
<jjwt.version>0.9.1</jjwt.version>
72-
<spring-native.version>0.11.4</spring-native.version>
96+
<spring-native.version>0.11.5</spring-native.version>
7397
<therapi-runtime-javadoc.version>0.13.0</therapi-runtime-javadoc.version>
7498
<spring-cloud-function.version>4.0.0-M2</spring-cloud-function.version>
7599
</properties>
@@ -130,6 +154,22 @@
130154
<artifactId>spring-native</artifactId>
131155
<version>${spring-native.version}</version>
132156
</dependency>
157+
<!-- spring Cloud -->
158+
<dependency>
159+
<groupId>org.springframework.cloud</groupId>
160+
<artifactId>spring-cloud-function-web</artifactId>
161+
<version>${spring-cloud-function.version}</version>
162+
</dependency>
163+
<dependency>
164+
<groupId>org.springframework.cloud</groupId>
165+
<artifactId>spring-cloud-starter-function-web</artifactId>
166+
<version>${spring-cloud-function.version}</version>
167+
</dependency>
168+
<dependency>
169+
<groupId>org.springframework.cloud</groupId>
170+
<artifactId>spring-cloud-starter-function-webflux</artifactId>
171+
<version>${spring-cloud-function.version}</version>
172+
</dependency>
133173
<!-- SpringDoc -->
134174
<dependency>
135175
<groupId>org.springdoc</groupId>
@@ -156,13 +196,6 @@
156196
<artifactId>springdoc-openapi-starter-webflux-ui</artifactId>
157197
<version>${project.version}</version>
158198
</dependency>
159-
<dependency>
160-
<groupId>org.springframework.cloud</groupId>
161-
<artifactId>spring-cloud-function-parent</artifactId>
162-
<version>${spring-cloud-function.version}</version>
163-
<type>pom</type>
164-
<scope>import</scope>
165-
</dependency>
166199
</dependencies>
167200
</dependencyManagement>
168201
<dependencies>

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -174,23 +174,6 @@ public class OpenAPIService implements ApplicationContextAware {
174174
*/
175175
private static Class<?> basicErrorController;
176176

177-
static {
178-
try {
179-
//spring-boot 2
180-
basicErrorController = Class.forName("org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController");
181-
}
182-
catch (ClassNotFoundException e) {
183-
//spring-boot 1
184-
try {
185-
basicErrorController = Class.forName("org.springframework.boot.autoconfigure.web.BasicErrorController");
186-
}
187-
catch (ClassNotFoundException classNotFoundException) {
188-
//Basic error controller class not found
189-
LOGGER.trace(classNotFoundException.getMessage());
190-
}
191-
}
192-
}
193-
194177
/**
195178
* Instantiates a new Open api builder.
196179
*

springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/AbstractSpringDocActuatorTest.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
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+
125
package test.org.springdoc.ui;
226

327
import jakarta.annotation.PostConstruct;
428

5-
import org.springframework.boot.actuate.autoconfigure.web.server.LocalManagementPort;
29+
import org.springframework.boot.test.web.server.LocalManagementPort;
630
import org.springframework.web.reactive.function.client.WebClient;
731

832
public abstract class AbstractSpringDocActuatorTest extends AbstractCommonTest{

springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app13/SpringDocApp13Test.java

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
/*
22
*
3-
* * Copyright 2019-2020 the original author or authors.
43
* *
5-
* * Licensed under the Apache License, Version 2.0 (the "License");
6-
* * you may not use this file except in compliance with the License.
7-
* * You may obtain a copy of the License at
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+
* * *
821
* *
9-
* * https://www.apache.org/licenses/LICENSE-2.0
10-
* *
11-
* * Unless required by applicable law or agreed to in writing, software
12-
* * distributed under the License is distributed on an "AS IS" BASIS,
13-
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* * See the License for the specific language governing permissions and
15-
* * limitations under the License.
1622
*
1723
*/
1824

@@ -25,6 +31,7 @@
2531
import org.springframework.boot.autoconfigure.SpringBootApplication;
2632
import org.springframework.boot.test.context.SpringBootTest;
2733
import org.springframework.http.HttpStatus;
34+
import org.springframework.http.HttpStatusCode;
2835
import org.springframework.test.web.reactive.server.EntityExchangeResult;
2936

3037
import static org.assertj.core.api.Assertions.assertThat;
@@ -54,7 +61,7 @@ void testIndex() {
5461

5562
@Test
5663
public void testIndexActuator() {
57-
HttpStatus httpStatusMono = webClient.get().uri("/application/swagger-ui")
64+
HttpStatusCode httpStatusMono = webClient.get().uri("/application/swagger-ui")
5865
.exchangeToMono( clientResponse -> Mono.just(clientResponse.statusCode())).block();
5966
assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND);
6067
}

springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app14/SpringDocApp14Test.java

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
/*
22
*
3-
* * Copyright 2019-2020 the original author or authors.
43
* *
5-
* * Licensed under the Apache License, Version 2.0 (the "License");
6-
* * you may not use this file except in compliance with the License.
7-
* * You may obtain a copy of the License at
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+
* * *
821
* *
9-
* * https://www.apache.org/licenses/LICENSE-2.0
10-
* *
11-
* * Unless required by applicable law or agreed to in writing, software
12-
* * distributed under the License is distributed on an "AS IS" BASIS,
13-
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* * See the License for the specific language governing permissions and
15-
* * limitations under the License.
1622
*
1723
*/
1824

@@ -25,6 +31,7 @@
2531
import org.springframework.boot.autoconfigure.SpringBootApplication;
2632
import org.springframework.boot.test.context.SpringBootTest;
2733
import org.springframework.http.HttpStatus;
34+
import org.springframework.http.HttpStatusCode;
2835
import org.springframework.test.web.reactive.server.EntityExchangeResult;
2936

3037
import static org.assertj.core.api.Assertions.assertThat;
@@ -53,7 +60,7 @@ void testIndex() {
5360

5461
@Test
5562
public void testIndexActuator() {
56-
HttpStatus httpStatusMono = webClient.get().uri("/application/swagger-ui")
63+
HttpStatusCode httpStatusMono = webClient.get().uri("/application/swagger-ui")
5764
.exchangeToMono( clientResponse -> Mono.just(clientResponse.statusCode())).block();
5865
assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND);
5966
}

springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app15/SpringDocApp15Test.java

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
/*
22
*
3-
* * Copyright 2019-2020 the original author or authors.
43
* *
5-
* * Licensed under the Apache License, Version 2.0 (the "License");
6-
* * you may not use this file except in compliance with the License.
7-
* * You may obtain a copy of the License at
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+
* * *
821
* *
9-
* * https://www.apache.org/licenses/LICENSE-2.0
10-
* *
11-
* * Unless required by applicable law or agreed to in writing, software
12-
* * distributed under the License is distributed on an "AS IS" BASIS,
13-
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* * See the License for the specific language governing permissions and
15-
* * limitations under the License.
1622
*
1723
*/
1824

@@ -25,6 +31,7 @@
2531
import org.springframework.boot.autoconfigure.SpringBootApplication;
2632
import org.springframework.boot.test.context.SpringBootTest;
2733
import org.springframework.http.HttpStatus;
34+
import org.springframework.http.HttpStatusCode;
2835
import org.springframework.test.web.reactive.server.EntityExchangeResult;
2936

3037
import static org.assertj.core.api.Assertions.assertThat;
@@ -56,7 +63,7 @@ void testIndex() {
5663

5764
@Test
5865
public void testIndexActuator() {
59-
HttpStatus httpStatusMono = webClient.get().uri("/test/application/swagger-ui")
66+
HttpStatusCode httpStatusMono = webClient.get().uri("/test/application/swagger-ui")
6067
.exchangeToMono( clientResponse -> Mono.just(clientResponse.statusCode())).block();
6168
assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND);
6269
}

springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui/app16/SpringDocApp16Test.java

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
/*
22
*
3-
* * Copyright 2019-2020 the original author or authors.
43
* *
5-
* * Licensed under the Apache License, Version 2.0 (the "License");
6-
* * you may not use this file except in compliance with the License.
7-
* * You may obtain a copy of the License at
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+
* * *
821
* *
9-
* * https://www.apache.org/licenses/LICENSE-2.0
10-
* *
11-
* * Unless required by applicable law or agreed to in writing, software
12-
* * distributed under the License is distributed on an "AS IS" BASIS,
13-
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* * See the License for the specific language governing permissions and
15-
* * limitations under the License.
1622
*
1723
*/
1824

@@ -25,6 +31,7 @@
2531
import org.springframework.boot.autoconfigure.SpringBootApplication;
2632
import org.springframework.boot.test.context.SpringBootTest;
2733
import org.springframework.http.HttpStatus;
34+
import org.springframework.http.HttpStatusCode;
2835
import org.springframework.test.web.reactive.server.EntityExchangeResult;
2936

3037
import static org.assertj.core.api.Assertions.assertThat;
@@ -55,7 +62,7 @@ void testIndex() {
5562

5663
@Test
5764
public void testIndexActuator() {
58-
HttpStatus httpStatusMono = webClient.get().uri("/test/application/swagger-ui")
65+
HttpStatusCode httpStatusMono = webClient.get().uri("/test/application/swagger-ui")
5966
.exchangeToMono( clientResponse -> Mono.just(clientResponse.statusCode())).block();
6067
assertThat(httpStatusMono).isEqualTo(HttpStatus.FOUND);
6168
}

0 commit comments

Comments
 (0)