gregwhitaker / catnap

Partial JSON response framework for RESTful web services
Apache License 2.0
55 stars 15 forks source link

Swagger UI module is not working #2

Closed Chinna-SHS closed 8 years ago

Chinna-SHS commented 8 years ago

hi, catnap utility works great. I could see following issue while using swagger api. I am using swagger ui module in Spring-boot REST service

io.springfox springfox-swagger-ui 2.5.0

While try to access the following url, i am getting the error as like below URL --> http://localhost:8080/swagger-ui.html Error --> [o.s.web.servlet.PageNotFound] - No mapping found for HTTP request with URI [/swagger-ui.html] in DispatcherServlet with name 'dispatcherServlet'

If I comment @EnableCatnap annotation, my swagger works again. have you had any issue while using swagger ui module?

gregwhitaker commented 8 years ago

The issue is caused by the fact that the @EnableCatnap annotation uses Spring's DelegatingWebMvcConfiguration class under the covers. This is breaking Spring Boot's view resolver for static content. The swagger rest endpoints will work fine, but the UI is not going to work because Spring Boot is no longer able to load webjars off of the classpath. I'll have to look into a way to get around this issue. Perhaps I can create a separate module for Spring Boot that uses WebMvcConfigurerAdapter and preserves Spring Boot's static content view resolvers.

gregwhitaker commented 8 years ago

I have created a separate module for springboot. If you import com.github.gregwhitaker:catnap-springboot:2.1.0 you should be able to use the swagger ui without issues.

Chinna-SHS commented 8 years ago

Verified and works great. Thanks for the quick enhancement