The end of API v1 #4653
NicolasCARPi
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just a heads up: in 4.9 the APIv1 will still be there, but will throw an error and bail out:
curl -sk -H "Authorization: $KEY" https://elab.example.com/api/v1/experiments
APIv1 is deprecated and will be removed in future versions. Use APIv2. To suppress this message, add the query string "apiv1_is_dead". e.g. /experiments/32?apiv1_is_dead
So it is still possible to use apiv1, but it requires adding a query parameter.
It is really difficult to warn about deprecation in a REST API context. For instance, if the output would emit a warning, it would probably break things, and render the response invalid json. Adding a warning in the logs is useless because the user don't see them. Some API have a
meta
key to the response, which could allow holding such messages, but of course v1 (nor v2) doesn't have that.I find this approach reasonable, it requires a bit of work to make scripts work again, but it's super easy to fix. Then in 5.0 the apiv1 will be completely removed.
Because of the inherently distributed nature of the software (and lack of telemetry), I have absolutely no clue how widespread is apiv1 usage, so maybe there is just one guy in Nebraska, maybe more, who knows? 🤷♂️
Also, end users might not read the release notes, which makes me think I really have to write this code that will emit a notification to users with changelog or something.
Side note, https://github.com/elabftw/elabapy has been archived.
Beta Was this translation helpful? Give feedback.
All reactions