With pragmatic RESTful API approach, url is defined as
http://<host>:<port>/<apiname>/api/v1.0/...
where v1.0 is api version. Now all the clients will stick to this url and start using this api. Now new api version is launched http://<host>:<port>/<apiname>/api/v2.0/...
with some extra features. This change will break existing clients as all of them are using old version in their url. How to change REST api version without breaking existing client in java and spring mvc ?
e.g.
suppose I have one web app where I registered DispatcherServerlet with url pattern .../api/v1.0
. Now I have few more features in API which will be available as part of another version. Do I need to make one more web app in which contains url pattern ..,/api/v2.0
. The concerns are code duplication and need to maintain two web app.
General description will work. I do not want pass api version in header.