-
Notifications
You must be signed in to change notification settings - Fork 137
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
Versioning of the API #311
Comments
Whatever happens, the important thing is to inform all the authors of the apps which work with the Notes app. :) That would be @stefan-niedermann of the Android app and @pbek of QOwnNotes at least, probably more. cc @rullzer @MorrisJobke for API versioning questions – probably you have some valuable insight? |
Maybe cc @phedlund for the iOS cloud notes app |
Any opinions on this? Is the OCS API still state of the art? |
No strong opinions. The capabilities seems like a good place and we are using the version info there for the deck app too. |
This will be finally implemented in #474. The capabilities part is done, the only thing missing is the type of the new v1 API. Therefore, I did a short analysis of the advantages of OCS-Controller vs. API-Controller: advantages OCS
disadvantages OCS
conclusionI slightly tend to don't use OCS. What do you prefer @stefan-niedermann @phedlund ? |
I also tend to don't use OCS. Seems like the behavior would change more than i would thought and the advantages are not that big at all. Maybe we can discuss this again if we have an API v2.0 in the future with (possible) features like sharing notes - in this case OCS seems to make more sense to me. |
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 version1.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 version2.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 revision2.1
. All features belonging to other fields could be deactivated in the client or a warning could be presented to the user.The text was updated successfully, but these errors were encountered: