-
-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider sending .jsonld
files with the application/ld+json
content-type
#17
Comments
+1 Sending a JSON-LD file with the wrong media type might mean that clients can’t interpret it as JSON-LD. It is the content type who defines the semantics of a document. JSON by itself doesn’t have any. So strictly speaking, a client wouldn’t be allowed to interpret it as JSON-LD if it isn’t served with the right content type (or an HTTP Link header pointing to a context). |
Just chiming in to agree with @lanthaler. It's considered hacky wrt. Web architecture to try to interpret documents served as one content type as another content type. Don't make the application guess, serve the document w/ the correct content type. |
Ensure that clients interpret the content of `.jsonld` files correctly by serving them with the `application/ld+json` content-type. Also, ensure that `.jsonld` files aren't served with any of the `html` related headers, but are served compressed, and their character encoding is UTF-8. See also: * http://json-ld.org/ * http://json-ld.org/spec/latest/json-ld/A * http://www.w3.org/TR/json-ld/ * http://www.iana.org/assignments/media-types/application/ld+json * https://github.com/json-ld Ref: #17. Close: #17.
@lanthaler @msporny thanks for the comments guys, really appreciate it! (I just wanted to make sure this is worth adding, as for some file formats, web clients just ignore the |
Consider adding
AddType application/ld+json jsonld
, as JSON-LD (JSON for Linking Data) is in the final stages of standardization at W3C, and it seems the adoption is quite good.Useful links:
My question(s): Does sending
.jsonld
files with a differentContent-Type
thenapplication/ld+json
(e.g.:application/json
) have any downsides ? Or to put it differently: do we really need this newContent-Type
?(Cc: @gkellogg, @lanthaler, @msporny)
The text was updated successfully, but these errors were encountered: