Skip to content

Commit a0a181a

Browse files
author
bnasslahsen
committed
PR#355 merge
2 parents e4f5a0d + 4f34ab3 commit a0a181a

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

springdoc-openapi-common/src/main/java/org/springdoc/core/AbstractResponseBuilder.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
import org.springframework.web.bind.annotation.ResponseStatus;
2424
import org.springframework.web.method.HandlerMethod;
2525

26-
import java.lang.reflect.Method;
27-
import java.lang.reflect.ParameterizedType;
28-
import java.lang.reflect.Type;
26+
import java.lang.reflect.*;
2927
import java.util.*;
3028
import java.util.stream.Collectors;
3129
import java.util.stream.Stream;
@@ -344,4 +342,15 @@ private boolean isVoid(Type returnType) {
344342
return Void.TYPE.equals(returnType) || (returnType instanceof ParameterizedType
345343
&& Void.class.equals(((ParameterizedType) returnType).getActualTypeArguments()[0]));
346344
}
345+
346+
interface ReturnTypeParser {
347+
Type getReturnType(Method method);
348+
}
349+
350+
public static class GenericReturnTypeParser implements ReturnTypeParser {
351+
@Override
352+
public Type getReturnType(Method method) {
353+
return method.getGenericReturnType();
354+
}
355+
}
347356
}

springdoc-openapi-common/src/main/java/org/springdoc/core/ReturnTypeParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.lang.reflect.Method;
44
import java.lang.reflect.Type;
55

6-
interface ReturnTypeParser {
6+
public interface ReturnTypeParser {
77
default Type getReturnType(Method method) {
88
return method.getGenericReturnType();
99
}

springdoc-openapi-security/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
<artifactId>springdoc-openapi-security</artifactId>
1111

12+
<properties>
13+
<jaxb-impl.version>2.1</jaxb-impl.version>
14+
</properties>
15+
1216
<dependencies>
1317
<!-- springdoc-common -->
1418
<dependency>
@@ -41,6 +45,12 @@
4145
<artifactId>hibernate-validator</artifactId>
4246
<scope>test</scope>
4347
</dependency>
48+
<dependency>
49+
<groupId>javax.xml</groupId>
50+
<artifactId>jaxb-impl</artifactId>
51+
<version>${jaxb-impl.version}</version>
52+
<scope>test</scope>
53+
</dependency>
4454
</dependencies>
4555

4656
</project>

springdoc-openapi-webmvc-core/src/test/java/test/org/springdoc/api/app72/CacheAutoConfigurationTest1.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package test.org.springdoc.api.app72;
22

33
import org.junit.Test;
4-
import org.springframework.boot.SpringBootConfiguration;
54
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
65
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
76

0 commit comments

Comments
 (0)