Skip to content

Commit 60de6d4

Browse files
committed
code review
1 parent 627df67 commit 60de6d4

File tree

1 file changed

+107
-2
lines changed

1 file changed

+107
-2
lines changed

springdoc-openapi-ui/src/main/java/org/springdoc/webmvc/ui/SwaggerWebMvcConfigurer.java

Lines changed: 107 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,29 @@
2020

2121
package org.springdoc.webmvc.ui;
2222

23+
import java.util.List;
2324
import java.util.Optional;
2425

2526
import org.springdoc.core.SwaggerUiConfigParameters;
2627
import org.springdoc.core.providers.ActuatorProvider;
2728

29+
import org.springframework.format.FormatterRegistry;
30+
import org.springframework.http.converter.HttpMessageConverter;
31+
import org.springframework.lang.Nullable;
32+
import org.springframework.validation.MessageCodesResolver;
33+
import org.springframework.validation.Validator;
34+
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
35+
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
36+
import org.springframework.web.servlet.HandlerExceptionResolver;
37+
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
38+
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
39+
import org.springframework.web.servlet.config.annotation.CorsRegistry;
40+
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
41+
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
42+
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
2843
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
44+
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
45+
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
2946
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
3047

3148
import static org.springdoc.core.Constants.CLASSPATH_RESOURCE_LOCATION;
@@ -37,8 +54,7 @@
3754
* The type Swagger web mvc configurer.
3855
* @author bnasslahsen
3956
*/
40-
@SuppressWarnings("deprecation")
41-
public class SwaggerWebMvcConfigurer implements WebMvcConfigurer { // NOSONAR
57+
public class SwaggerWebMvcConfigurer implements WebMvcConfigurer {
4258

4359
/**
4460
* The Swagger path.
@@ -84,4 +100,93 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
84100
.addTransformer(swaggerIndexTransformer);
85101
}
86102

103+
@Override
104+
public void configurePathMatch(PathMatchConfigurer configurer) {
105+
// This implementation is empty to keep compatibility with spring 4 applications.
106+
}
107+
108+
109+
@Override
110+
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
111+
// This implementation is empty to keep compatibility with spring 4 applications.
112+
}
113+
114+
@Override
115+
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
116+
// This implementation is empty to keep compatibility with spring 4 applications.
117+
}
118+
119+
@Override
120+
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
121+
// This implementation is empty to keep compatibility with spring 4 applications.
122+
}
123+
124+
@Override
125+
public void addFormatters(FormatterRegistry registry) {
126+
// This implementation is empty to keep compatibility with spring 4 applications.
127+
}
128+
129+
@Override
130+
public void addInterceptors(InterceptorRegistry registry) {
131+
// This implementation is empty to keep compatibility with spring 4 applications.
132+
}
133+
134+
@Override
135+
public void addCorsMappings(CorsRegistry registry) {
136+
// This implementation is empty to keep compatibility with spring 4 applications.
137+
}
138+
139+
@Override
140+
public void addViewControllers(ViewControllerRegistry registry) {
141+
// This implementation is empty to keep compatibility with spring 4 applications.
142+
}
143+
144+
@Override
145+
public void configureViewResolvers(ViewResolverRegistry registry) {
146+
// This implementation is empty to keep compatibility with spring 4 applications.
147+
}
148+
149+
@Override
150+
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
151+
// This implementation is empty to keep compatibility with spring 4 applications.
152+
}
153+
154+
@Override
155+
public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) {
156+
// This implementation is empty to keep compatibility with spring 4 applications.
157+
}
158+
159+
@Override
160+
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
161+
// This implementation is empty to keep compatibility with spring 4 applications.
162+
}
163+
164+
@Override
165+
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
166+
// This implementation is empty to keep compatibility with spring 4 applications.
167+
}
168+
169+
@Override
170+
public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
171+
// This implementation is empty to keep compatibility with spring 4 applications.
172+
}
173+
174+
@Override
175+
public void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
176+
// This implementation is empty to keep compatibility with spring 4 applications.
177+
}
178+
179+
@Override
180+
@Nullable
181+
public Validator getValidator() {
182+
// This implementation is empty to keep compatibility with spring 4 applications.
183+
return null;
184+
}
185+
186+
@Override
187+
@Nullable
188+
public MessageCodesResolver getMessageCodesResolver() {
189+
// This implementation is empty to keep compatibility with spring 4 applications.
190+
return null;
191+
}
87192
}

0 commit comments

Comments
 (0)