> 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 > application/foo+xml? > > 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 > text/calendar+xml. Making it work with respond_to :"vnd.foo-v1+json" seems fine, though. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
