-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Versioning #5430
Comments
I can think of no good reason to support multiple versions on the backend, nor really any reason to version the API at all. We version stored objects because we may need to upgrade them, but for APIs we can simply follow the already understood semver rules of Kibana |
Versioning APIs is always a major pain — everything is so much easier if we can avoid it. |
To narrow the scope of this issue, it is only about future REST APIs. The use case for this is so that outside code can depend on the API format for the REST endpoint(s). In particular, by creating an API version that is separate from the application version, users can depend on the endpoint more simply. This is particularly relevant for any ingestion endpoints, where tools can be written and deployed without the ability to easily update them. They can talk to a version of the ingest API, even as newer versions of it get released. For example, imagine Elasticsearch removes PUT /{index}/{type}/{id}
{}
POST /{index}/{type}
{}
POST /{?index}/{?type}/_bulk
{"index":{"index":"", "type":""}
{} There's no avoiding such a breaking change. Versioning the API wouldn't save you (they either want to send In a less scary example, imagine that Kibana has an API to create new Index Patterns that uses The strictness therefore lands at our feet in such a world. We can make breaking changes to such APIs, but ideally we can add them in BWC ways, or by adding a new version that lives beside the old [deprecated] version. In the worst case, we can still make a scary Breaking Change that simply prevents them from working. At that point, when the API doesn't exist, it's up for the application to react (e.g., degrade to the older version or simply fail) rather than calling it and hoping for the best. |
…rocess Add additional info to create output
As we begin to add API endpoints to Kibana (#5199), we should think about how we want to handle versioning. The big questions are 1. Where does the version info go in the request and 2. How do we support multiple versions on the backend?
Some popular options:
I personally prefer the accept header because that's the sort of thing content type negotiation is for, custom headers are hacky and URLs should specify a resource not an API version.
The text was updated successfully, but these errors were encountered: