Proposal sounds good to me. I would agree to move this to a plugin that gets
the accept header (is there anything else?) and can update any existing
selectors/extension/suffix (the PathInfo) parsed already.
void updatePathInfo(String[] accepts, PathInfo pathInfo);
Notes:
- accept header already parsed (might need to be a special object to include
weights)
- PathInfo is basically a RequestPathInfo with setters
While the default would not do anything if something was taken from the URL,
this might still be useful once you support accept headers this way, and
applications could extend that behaviour. Or simply turn it off (as it is now).
Cheers,
Alex
On 07.04.2014, at 13:39, Julian Reschke <[email protected]> wrote:
> On 2014-04-07 15:59, Felix Meschberger wrote:
>> Hi
>>
>> Ok, it is not exactly arbitrary logic. Turns out that content types of the
>> style
>>
>>> application/someformat+somesyntax
>>
>> are pretty common (see [1], [2]). Also when talking about REST-ful APIs I
>> expect some application on the other (client) side and this will in general
>> not come with a list of content types but with a single one asking for a
>> concrete representation.
>> ...
>
> The "structured syntax" is defined in <http://tools.ietf.org/html/rfc6839> --
> note that you can't simply make up these suffixes (nor media types...).
>
> Best regards, Julian
>