I have created an application which is exposed as a web service. I am trying to follow REST principles. I am using Spring 4.
What I have done so far is to create my own mime type application/vnd.mycompany-v1+json
. From the clients accessing the web service I say which version I want (currently only one).
However, this is not all I need to do. I also need to keep different versions of the resources since I may add/remove properties etc from one version to another. What is the approach to solve this? Do you create a package for each version?
com.mycompany.web.resources.v1.Bike
, com.mycompany.web.resources.v2.Bike
, etc? This approach would work I guess but the number of versions is not known in this stage so it could be a large list of duplicates. I don't know if this is a problem or if it is the way it must be?
I guess I am not the first one thinking of versioning the resources too so how is this handled?