Hi,
I have the requirement to support versioning on my REST API in a legacy application I have inherited. I have to implement the versioning of the resources via a version segment of the URL, as that is what we have advertised we are doing. e.g. /myRoot/v1/myResource and /myRoot/v2/myResource. Currently my REST API has the following config (I.e. Everything is hardcoded to appear at v1):
<jaxrs:server id="myService" address="/v1" name="myService">
…
</jaxrs:server>
I have updated by serviceBeans so that they now expect to receive the /v[0-9]+ segment as a path parameter:
@Path("/{version:v[0-9]+}/myResource")
And for that to work I have to move my jaxrs:server to the address="/"
However I have found there is already another jaxrs:server with address="/"
I don't want to mix my serviceBean with the one already sitting on "/" as both of us have interceptors and providers not suitable to each other. Also I don't want to change the URLs of any of the resources as this will break clients..
Is there any solution to this dilemma?
Thanks
Duncan
I have the requirement to support versioning on my REST API in a legacy application I have inherited. I have to implement the versioning of the resources via a version segment of the URL, as that is what we have advertised we are doing. e.g. /myRoot/v1/myResource and /myRoot/v2/myResource. Currently my REST API has the following config (I.e. Everything is hardcoded to appear at v1):
<jaxrs:server id="myService" address="/v1" name="myService">
…
</jaxrs:server>
I have updated by serviceBeans so that they now expect to receive the /v[0-9]+ segment as a path parameter:
@Path("/{version:v[0-9]+}/myResource")
And for that to work I have to move my jaxrs:server to the address="/"
However I have found there is already another jaxrs:server with address="/"
I don't want to mix my serviceBean with the one already sitting on "/" as both of us have interceptors and providers not suitable to each other. Also I don't want to change the URLs of any of the resources as this will break clients..
Is there any solution to this dilemma?
Thanks
Duncan