File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed
springdoc-openapi-common/src/main/java/org/springdoc/core
springdoc-openapi-security
springdoc-openapi-webmvc-core/src/test/java/test/org/springdoc/api/app72 Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 2323import org .springframework .web .bind .annotation .ResponseStatus ;
2424import 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 .*;
2927import java .util .*;
3028import java .util .stream .Collectors ;
3129import 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}
Original file line number Diff line number Diff line change 33import java .lang .reflect .Method ;
44import java .lang .reflect .Type ;
55
6- interface ReturnTypeParser {
6+ public interface ReturnTypeParser {
77 default Type getReturnType (Method method ) {
88 return method .getGenericReturnType ();
99 }
Original file line number Diff line number Diff line change 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 >
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 >
Original file line number Diff line number Diff line change 11package test .org .springdoc .api .app72 ;
22
33import org .junit .Test ;
4- import org .springframework .boot .SpringBootConfiguration ;
54import org .springframework .boot .autoconfigure .EnableAutoConfiguration ;
65import org .springframework .boot .test .context .runner .WebApplicationContextRunner ;
76
You can’t perform that action at this time.
0 commit comments