-
Notifications
You must be signed in to change notification settings - Fork 146
Description
Background
Until now, all changes of the API for mobile clients were fully backward compatible. This was realized by ignoring all unknown fields from client resp. server. But someday, we will have to implement a breaking change (e.g. due to #190) and therefore introduce a new major version of the API.
Problem
Currently, clients can't request the supported API versions from the server. I.e., the client can't know which major version is compatible, instead it has to try it out (which is also the case in order to check if the notes app is installed at all). The client also doesn't know which minor version is used by the server, i.e., which fields will be processed by the server - e.g. does the server support setting favorites or categories (this was introduced in a minor version of "v0.2")?
Therefore, I would like to introduce a clearer versioning scheme in the upcoming app release 3.0 based on these considerations about major and minor version. However, I'm not sure, what's the best way?
Possible Solution
Nextcloud provides the capabilities API which may be a good point where to publish the list of supported API versions.
On the other hand, there is the OCS specification (see also developer manual), which supports versioning. However, it looks like there is only one version per service and it doesn't say anything about minor versions. Furthermore, the notes app doesn't use OCS yet - but we can change this!
Any opinions on this? @nextcloud/notes, @LukasReschke (as the author of the OCS specification).
My current plan is to use the capabilities API in order to provide a list of supported API versions, e.g. [1.3, 2.1]. A client that supports API version 1.2 will use the API endpoint under subpath /v1/ and knows that all fields sent by the client will be processed by the server. A client that supports API version 2.4 will use the API endpoint under subpath /v2/ and knows that only those fields will be processed by the server that are defined in revision 2.1. All features belonging to other fields could be deactivated in the client or a warning could be presented to the user.