You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Better support for RouteBuilder for deprecation removal vs. keep (#113712)
This commit is a follow up to #113151 to better clarify how to deprecate HTTP routes. That change
introduced RouteBuilder.deprecateAndKeep to enable the ability to deprecate an HTTP API, but
not require REST compatibilty headers in the next major version. This commit deprecates the java
methnod RouteBuilder.deprecated and introduces RouteBuilder.deprecatedForRemoval. The valid
options are now RouteBuilder.deprecateAndKeep vs. RouteBuilder.deprecatedForRemoval where
the later will require compatiblity headers to access the route in any newer REST API versions
than the lastFullySupportedVersion declared. The javadoc should help to provide some clarification.
Additionally, the deprecation level should not be configurable. The deprecation level of WARN,
when applied to routes, is informational only (and may require compatibility headers in the next version).
The deprecation level of CRITICAL means means no access what so ever in the next major version.
Generally, CRTICIAL is used for any cases where the compatibility is required (which means it is
the last version for any access), or no compatibility is planned.
Some examples:
```
Route.builder(GET, "/foo/bar").build() -> no deprecations
Route.builder(GET, "/foo/bar").deprecateAndKeep("my message").build() -> deprecated, but removal is not influenced by REST API compatibilty
Route.builder(GET, "/foo/bar").deprecatedForRemoval("my message", V_8).build() -> will be available in V_8, but emit a warn level deprecation, V_9 will require compatiblity headers and emit a CRITICAL deprecation, and V_10 this will no longer be available
Route.builder(GET, "/foo/bar").replaces(GET, "/foo/baz", V_8).build() -> /foo/bar will be available in all versions. /foo/baz will be available in V_8 but emit a warn level deprecation, V_9 will require compatibility headers and emit a CRITICAL deprecation, and V_10 this will no longer be available. This is effectively a short cut to register a new route ("/foo/bar") and deprecatedForRemoval the path being replaced.
```
The functionality remains unchanged and this refactoring only provides better contracts
and cleans up some of the implementation.
0 commit comments