Currently there isn't a great way for clients to understand that an http route has been deprecated:
- In most cases we aren't logging warnings on the server when a deprecated route has been hit
- For documented REST APIs, our only option is to use the docs to indicate that the route has been deprecated
Elasticsearch solves this problem with a Warning header that includes a 299 miscellaneous warn code and follows the RFC7234 spec for warning headers.
Example:
Warning: 299 Elasticsearch-8.0.0-###"Your license will expire in [N] days. Contact your administrator or update your license for continued use of features"
It would be useful if Kibana's http routes could be registered with some text that gets interpolated into a warning header, or perhaps a simple isDeprecated flag that would automatically produce a warning header. While deprecations is the obvious use case that comes to mind, there may be others as well.
As for the structure, I'd propose that we match the header structure to the same spec that Elasticsearch is using.
(cc @kobelb)
Currently there isn't a great way for clients to understand that an http route has been deprecated:
Elasticsearch solves this problem with a
Warningheader that includes a299miscellaneous warn code and follows the RFC7234 spec for warning headers.Example:
Warning: 299 Elasticsearch-8.0.0-###"Your license will expire in [N] days. Contact your administrator or update your license for continued use of features"It would be useful if Kibana's http routes could be registered with some text that gets interpolated into a warning header, or perhaps a simple
isDeprecatedflag that would automatically produce a warning header. While deprecations is the obvious use case that comes to mind, there may be others as well.As for the structure, I'd propose that we match the header structure to the same spec that Elasticsearch is using.
(cc @kobelb)