dschulten / hydra-java

Annotate your Java beans and serialize them as json-ld with hydra
Apache License 2.0
108 stars 27 forks source link

MediaType constant #6

Closed ceefour closed 9 years ago

ceefour commented 9 years ago
public static final String APPLICATION_JSONLD_STR = "application/ld+json";
public static final MediaType APPLICATION_JSONLD = MediaType.parseMediaType(APPLICATION_JSONLD_STR);

this should be a public constant somewhere accessible... Or better yet, should propose inclusion of this constant into https://github.com/spring-projects/spring-hateoas

The String is useful for @RequestMapping.

I wonder if should propose the other MediaType constants as well (Collections+JSON, SIREN, JSONAPI) to spring-hateoas?

dschulten commented 9 years ago

Will be a constant on HypermediaConstants in the next release.

As for spring-hateoas: you could try, but as far as I understand Oliver, these media types are not going to be part of spring-hateoas in the foreseeable future. Full support for media types is up to implementers, spring-hateoas will only support a basic feature set (i.e. simple links in resources and UriTemplates).

ceefour commented 9 years ago

@olivergierke I think it's useful to have common hypermedia MediaType constants in spring-hateoas.

dschulten commented 9 years ago

added de.escalon.hypermedia.spring.HypermediaTypes in 0.2.0-SNAPSHOT