Info about my project:
- Open Java 11.01
- springdoc-openapi-ui 1.5.2
- Spring core 5.1.2.RELEASE
- Spring boot 2.1.0.RELEASE
With this controller without implements this Interface I can generate this API-doc:
@RestController
public class MissionApiImpl implements MissionApi {
@Override
@GetMapping("/test")
public ResponseEntity<Void> test() {
return new ResponseEntity( HttpStatus.OK );
}
}
Generated doc:
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":
[{"url":"http://localhost:9000/mgb/v6.0.0","description":"Generated server url"}],"paths":{"/test":
{"get":{"tags":["mission-api-impl"],"operationId":"test","responses":{"200":
{"description":"OK"}}}}},"components":{}}
But with this interface:
public interface MissionApi {
ResponseEntity<Void> test();
}
I Have this error:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:890)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0
at org.springframework.web.method.HandlerMethod$HandlerMethodParameter.getParameterAnnotations(HandlerMethod.java:430)
a
Any idea why?
I tried to migrate this Getter annotations to interface etc, but still the same error.