I have a Rails backend that serves multiple clients:
- Angular JS App
- iOS App
At first, I only had the iOS App, and used classical API versioning in rails when substantial changes were brought to the client (naming my versions v1
, v2
and so on).
When we came up with the Angular front end, we needed a specific API, so I did a new version that I would use only with Angular (let's say v5
).
At that point, v1
through v4
are dedicated to iOS, and v5
to Angular.
Obviously, I can simultaneously update my backend along with my Angular API, since both are served to the client every time they access the website. Therefore, there is no need for the Angular API to be versioned.
However, I'm at that point where I need to update my iOS API, and it is starting to get very wrong : v1
..v4
are for iOS, and v5
is taken by Android. So the supposed next iOS API should be... v6
? Definitely wrong.
I wanted to know if it was possible to name an API version angular
, and thanks to this answer on SO I understand why this is not possible. I'll quote the interesting part for my case:
Ryan Bigg wrote:
I couldn't figure out how to get
/api/asdf/users
to match, because how do you determine if that is supposed to be a request to/api/<resource>/<identifier>
or/api/<version>/<resource>
?
Now you understand better my situation, here's the question.
The question
How am I supposed to manage multiple APIs, but which are not really like versions?
Is it possible to subdivide API versions? Like:
api/angular/v1
api/ios/v5
(movingv1
..v4
toapi/ios/
as well)api/android/v1
Is there any best practice to do so? Or should I just be using the current API versioning system, knowing which version corresponds to which client?