Package com.wilfredmorgan.api.config
Class SwaggerWebMVC
- java.lang.Object
-
- com.wilfredmorgan.api.config.SwaggerWebMVC
-
- All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Configuration public class SwaggerWebMVC extends java.lang.Object implements org.springframework.web.servlet.config.annotation.WebMvcConfigurerThe application turns off any automatic web page generate done by Spring. This is done to improve exception handling. However, we do need some web page generate done for Swagger, so we do that here.
-
-
Constructor Summary
Constructors Constructor Description SwaggerWebMVC()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)Adds the Swagger web pages to Spring.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
addArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
-
-
-
-
Method Detail
-
addResourceHandlers
public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
Adds the Swagger web pages to Spring. This still gives the following warningNo mapping for GET / No mapping for GET /csrf
All works though
- Specified by:
addResourceHandlersin interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer- Parameters:
registry- the place that holds the web pages for Spring
-
-