[Resteasy-users] multiple resource locator for same uri

2014-04-06 Thread Aleš Bregar
Hi,

was going through docs on version 2.3.x but couldn't find appropriate answer on 
may issue.

I would like to produce versioned api where uri does not change. The idea is to 
intercept resource locating before auto match happen and decide which method to 
invoke based on some custom header (eq. Api.Version=x).

I have found that this can also be achieved by using Accept header (where 
version info may be stated) but I am not truly convinced due I would like to 
produce plain application/json.

Or if my idea with custom header presented above is ok, how the scenario may be 
produced by using resteasy.
PreProcess interceptor seems not right as it intercepts after regex match to 
method happen.

Thank you in advance



--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] multiple resource locator for same uri

2014-04-06 Thread Aleš Bregar
Hi,

was going through docs on version 2.3.x but couldn't find appropriate answer on 
may issue.

I would like to produce versioned api where uri does not change. The idea is to 
intercept resource locating before auto match happen and decide which method to 
invoke based on some custom header (eq. Api.Version=x).

I have found that this can also be achieved by using Accept header (where 
version info may be stated) but I am not truly convinced due I would like to 
produce plain application/json.

Or if my idea with custom header presented above is ok, how the scenario may be 
produced by using resteasy.
PreProcess interceptor seems not right as it intercepts after regex match to 
method happen.

Thank you in advance



--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] multiple resource locator for same uri

2014-04-06 Thread Bill Burke
Resteasy cannot dispatch based on header, but I don't recommend a custom 
header anyways.  The best practice solution is to use URIs i.e. 
/v1.0/api and have your client driven by links.  You should also make 
your apis and media types backward compatible.  Its just good practice 
no matter what type of API, REST, Java, or whatever you're doing.

A custom header can often be removed by proxies.  For CORS requests, you 
also have to write custom code to handle custom headers on the server-side.


On 4/6/2014 8:06 AM, Aleš Bregar wrote:
 Hi,

 was going through docs on version 2.3.x but couldn't find appropriate
 answer on may issue.

 I would like to produce versioned api where uri does not change. The
 idea is to intercept resource locating before auto match happen and
 decide which method to invoke based on some custom header (eq.
 Api.Version=x).

 I have found that this can also be achieved by using Accept header
 (where version info may be stated) but I am not truly convinced due I
 would like to produce plain application/json.

 Or if my idea with custom header presented above is ok, how the scenario
 may be produced by using resteasy.
 PreProcess interceptor seems not right as it intercepts after regex
 match to method happen.

 Thank you in advance





 --



 ___
 Resteasy-users mailing list
 Resteasy-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/resteasy-users


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users