mikekelly / hal_specification

HAL Specification
http://stateless.co/hal_specification.html
619 stars 58 forks source link

What is the proper media-type for HAL/JSON, especially in the context of wildcards and custom-media-types? #23

Closed vivin closed 8 years ago

vivin commented 9 years ago

I have seen custom media-types that support HAL described as follows:

It seems like the second and third formats are illegal per section 4.2.8 of RFC6838 since it says that only registered suffixes should be used.

Another question I have is regarding the format for wildcard HAL. Which one of the following is correct?

Based on the previously-mentioned RFC, I am assuming that application/*+hal+json is illegal as well.

vivin commented 9 years ago

bump

vivin commented 9 years ago

I've summarized my concerns in a StackOverflow question. Although the question talks about Spring HATEOAS, a lot of the confusion is because it's not clear what the correct wild-card type is for HAL+JSON.

Is there a plan to make +hal+json a registered suffix?

Lewiscowles1986 commented 8 years ago

Very interested to know what content type should be used

mikekelly commented 8 years ago

I wouldn't worry about this too much, the identifier is basically an opaque string from a machine processing point of view so as long as it conveys clearly that it is based on "hal+json" then I think you're good.

Maybe someone who understands the minutiae of IANA media type identifier rules can tell you which is right. If they don't turn up just go with whatever you like :)