Class StandardApiVersionDeprecationHandler

java.lang.Object
org.springframework.web.reactive.accept.StandardApiVersionDeprecationHandler
All Implemented Interfaces:
ApiVersionDeprecationHandler

public class StandardApiVersionDeprecationHandler extends Object implements ApiVersionDeprecationHandler
ApiVersionDeprecationHandler based on RFC 9745 and RFC 8594 that provides the option to set the "Deprecation" and "Sunset" response headers, as well as to add "Link" headers with further details about both.

To use this handler, create an instance, call configureVersion(String) for each deprecated version, and use the returned StandardApiVersionDeprecationHandler.VersionSpec to provide the deprecation details to send to clients.

Since:
7.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • StandardApiVersionDeprecationHandler

      public StandardApiVersionDeprecationHandler()
      Create an instance.

      By default, SemanticApiVersionParser is used to parse configured API versions, so those can be compared to request versions parsed at runtime. If you have a custom parser, then please use the StandardApiVersionDeprecationHandler(ApiVersionParser) constructor.

    • StandardApiVersionDeprecationHandler

      public StandardApiVersionDeprecationHandler(ApiVersionParser<?> parser)
      Variant of the default constructor with a custom ApiVersionParser. This needs to be the same as the parser type used at runtime to parse request versions.
  • Method Details