Updating com.atlassian.oai.validator.springmvc.OpenApiValidationInterceptor in the latest releases?
Hi,
With Spring 6 HandlerInterceptorAdapter (deprecated class in Spring 5) which OpenApiValidationInterceptor extends is no longer available. Is there any plan to replace HandlerInterceptorAdapter
so that OpenApiValidationInterceptor is available to use with Spring 6?
Comments (7)
-
-
I believe that this issue is closely related to
#404. The removal ofHandlerInterceptorAdapter
is only one of the dealbreakers introduced with Spring 6.While you can work around the issue by adding your own
HandlerInterceptorAdapter
like this:package org.springframework.web.servlet.handler; import org.springframework.web.servlet.HandlerInterceptor; public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {}
… you would be able to compile code using it, however, if you - like probably most others - are using Spring 6 in combination with SpringBoot 3, you’d run straight into a problem caused by the namespace change for servlet APIs like e.g.
HttpServletRequest
.It looks like anyone trying to upgrade to Spring6/SpringBoot3 will for now be simply unable to use the swagger-request-validator until
#404has been fixed.Since there isn’t really any alternative to this (excellent, by the way, and thank you very much!) library, we’re pretty much facing a blocker keeping us from using the latest stable Spring/SpringBoot versions in new projects.
-
This issue is very closely related to
#399, because it’s a duplicate.It has been already covered and merged. Simply replace this old
swagger-request-validator-springmvc
dependency with the newswagger-request-validator-spring-webmvc
dependency and you are good to go.
Issue
#404, actually, simply uses a method, that has been removed in Spring Boot 3. It’s one of the rare cases where the Jakarta namespace change is not the problem. -
Meaning that after
#404has been fixed and merged, the library will be usable with Spring6/SpringBoot3? That would be extremely good news as I am currently in the process of fixing issues related to that upgrade, and this here is currently one of the things I cannot easily fix myself ;) -
Meaning that it already works with the latest version.
#399is done. Simply useswagger-request-validator-spring-webmvc
instead ofswagger-request-validator-springmvc
.This issue can be closed as duplicate.
-
It seems to work, thank you very much!
-
- changed status to duplicate
Duplicate of
#399. - Log in to comment
That upgrade has already been covered.
You may want to change the artifactId of your dependency from
swagger-request-validator-springmvc
toswagger-request-validator-spring-webmvc
- version >= 2.33.1.swagger-request-validator-springmvc
is still used for Spring 5 applications.swagger-request-validator-spring-webmvc
is used for Spring 6 applications.Because of the breaking changes with that upgrade and Spring 5 very much alive and kicking we decided to add a new artifact.