-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Spring Boot + Jersery2 + Swagger2 It can't work at the same time #1816
Comments
Take a look at this tutorial about SpringBoot + Swagger: http://heidloff.net/article/usage-of-swagger-2-0-in-spring-boot-applications-to-document-apis/ |
but it is Spring Boot + Swagger2.0 , Not have Jersey, Not is Jersey's tage. I want Spring Boot + Jersey +swagger. |
I suggest you get your resource from spring context before registering in your Jersey config. If you want to run an aspect you'll need spring to be aware. WebApplicationContext springFactory = WebApplicationContextUtils.getWebApplicationContext(servletContext); |
@youkuan I have the same problem. Did you find a solution? |
Spring Boot + Jersery2 + Swagger2 It can't work at the same time
Spring Boot Application run
BootStartInitialization.class
public static void main(String[] args) {
SpringApplication.run(BootStartInitialization.class, args);
}
Jersey Configuraction
public class JerseyConfig extends ResourceConfig {
}
Swagger2 Configuraction
@configuration
@EnableSwagger2
public class Swagger2 {
API Controller(Resource)
@component
@controller
@RequestMapping(value="/accounts")
@path("/accounts")
@Api(value = "accounts manager")
@produces(MediaType.APPLICATION_JSON)
@consumes(MediaType.APPLICATION_JSON)
public class UserController {
}
open http://localhost:8080/swagger-ui.html, no display api docment. on found sub api.
can't display http://localhost:8080/accounts/{userId} api document.
It can't work at the same time
Spring Boot + Jersey + Swagger Not run?
who is this close? why ? this question not solved.
The text was updated successfully, but these errors were encountered: