Use application/ld+json as Content-Type for the Omeka S API
coret opened this issue · comments
Currently the Content-Type of the of the API response is application/json; charset=utf-8
(like https://www.goudatijdmachine.nl/omeka/api/items/37476 and also the context https://www.goudatijdmachine.nl/omeka/api-context).
The Omeka S API outputs a more specific kind of JSON: JSON-LD. So the content-type of these responses from the Omeka S API should reflect this and use the Content-Type application/ld+json; charset=utf-8
(see also https://www.w3.org/TR/json-ld11/).
I stumbled on this issue while using the (standards adhering) tool https://sketch.zazuko.com/ - I pasted the output of the Omeka S API into this tool and it showed the (correct) error:
Error:
Failed to load remote context https://www.goudatijdmachine.nl/omeka/api-context:
Unsupported JSON-LD media type application/json
The API will return an application/ld+json
content type in an upcoming release. In fact, consumers will be able to request other formats, such as RDF XML, N3, Turtle, and N-Triples, each with their corresponding content type.