Shouldn't Rails coerce these new almost standart headers to application/json
and applicatioin/xml (for previous example) ?
No, because 'application/vnd.foo-v1+json' is not 'application/json.'
The "+foo" convention was actually introduced in RFC3023, specifically
for XML formats. But it's only a convention, as the RFC says:
A.13 What is the semantic difference between application/foo and
MIME processors that are unaware of XML will treat the '+xml' suffix
as completely opaque, so it is essential that no extra semantics be
assigned to its presence. Therefore, application/foo and
application/foo+xml SHOULD be treated as completely independent media
types. Although, for example, text/calendar+xml could be an XML
version of text/calendar[RFC2445], it is possible that this
(hypothetical) new media type would include new semantics as well as
new syntax, and in any case, there would be many applications that
support text/calendar but had not yet been upgraded to support
Making it work with respond_to :"vnd.foo-v1+json" seems fine, though.