-
-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the controller inherits a generic class, there is an infinite loop #2271
Comments
I think it seems that it's because of this |
@wenqiuhan did you resolve the issue? |
No, I debugged the code and just thought it might be due to this reason |
Hello, I'm seeing this loop problems, but does this change solve your problem? It stops going into the loop. public abstract class SuperController<T extends SuperEntity<T>> {
@GetMapping({"page/{current}/{size}", "page"})
public <R extends T> List<R> findPage(@PathVariable(required = false) Long current,
@PathVariable(required = false) Long size,
@RequestParam(required = false) T params) {
return new ArrayList<>();
}
} |
This method can solve it, but I see that you have submitted a record. If it can be merged into the main branch, I think it will be the final solution |
Hi, I sent this correction to prevent the error for other people without requiring them to make changes to their code. |
I'm a bit confused about what you mean. What I mean is that the code you submitted seems to solve the problem in the source code, and I feel like it can be merged into the code. |
I also encountered this issue, but I did not use super class in my code. Just springboot3.1.2, springdoc2.2 java.lang.StackOverflowError: null |
额,报错没必要贴这么多代码吧,我拉了半天,QVQ,而且你也把你写的贴出来啊? Well, there's no need to post so much code when reporting an error, right? I've been dragging for a while, QVQ, and you've also posted what you wrote? |
(HI,I'm sorry but English is not my native language, so I use Machine translation. If you have any doubts about the problems I described, please feel free to reply me.)
Problem Description
The controller's parent class has a generic type, and the return value of a method is a generic type,
When subclassing inheritance, the real type is provided, but when accessing doc. html, there will be an infinite loop. The specific code is as follows,
I don't know if this is a bug. If not, please tell me how to solve this problem
Dependencies version
spring-boot 3.0.5
springdoc-openapi-starter-webmvc-ui 2.0.4
springdoc-openapi-starter-common 2.0.4
Simplified the code to obtain the following code
Specific error reporting
The text was updated successfully, but these errors were encountered: