mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 14:09:25 +00:00
Expose handler to ApiVersionDeprecationHandler implementations
Closes gh-35750
This commit is contained in:
+4
-1
@@ -35,9 +35,12 @@ public interface ApiVersionDeprecationHandler {
|
||||
* accordingly, e.g. by setting response headers to signal the deprecation,
|
||||
* to specify relevant dates and provide links to further details.
|
||||
* @param version the resolved and parsed request version
|
||||
* @param handler the handler chosen for the request
|
||||
* @param request the current request
|
||||
* @param response the current response
|
||||
*/
|
||||
void handleVersion(Comparable<?> version, HttpServletRequest request, HttpServletResponse response);
|
||||
void handleVersion(
|
||||
Comparable<?> version, Object handler,
|
||||
HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
}
|
||||
|
||||
@@ -91,10 +91,12 @@ public interface ApiVersionStrategy {
|
||||
* accordingly, e.g. by setting response headers to signal the deprecation,
|
||||
* to specify relevant dates and provide links to further details.
|
||||
* @param version the resolved and parsed request version
|
||||
* @param handler the handler chosen for the request
|
||||
* @param request the current request
|
||||
* @param response the current response
|
||||
* @see ApiVersionDeprecationHandler
|
||||
*/
|
||||
void handleDeprecations(Comparable<?> version, HttpServletRequest request, HttpServletResponse response);
|
||||
void handleDeprecations(
|
||||
Comparable<?> version, Object handler, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
}
|
||||
|
||||
+4
-2
@@ -180,9 +180,11 @@ public class DefaultApiVersionStrategy implements ApiVersionStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDeprecations(Comparable<?> version, HttpServletRequest request, HttpServletResponse response) {
|
||||
public void handleDeprecations(
|
||||
Comparable<?> version, Object handler, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
if (this.deprecationHandler != null) {
|
||||
this.deprecationHandler.handleVersion(version, request, response);
|
||||
this.deprecationHandler.handleVersion(version, handler, request, response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -87,7 +87,8 @@ public class StandardApiVersionDeprecationHandler implements ApiVersionDeprecati
|
||||
|
||||
@Override
|
||||
public void handleVersion(
|
||||
Comparable<?> requestVersion, HttpServletRequest request, HttpServletResponse response) {
|
||||
Comparable<?> requestVersion, Object handler,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
for (VersionInfo info : this.infos.values()) {
|
||||
if (info.match(requestVersion, request)) {
|
||||
|
||||
Reference in New Issue
Block a user