-
Notifications
You must be signed in to change notification settings - Fork 71
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
Register a media-type with IANA #61
Comments
Yes, since it's a specific json schema, makes sense to do this. |
I can understand this is meaningful theoretically, but I am not yet understanding how this can be immediately beneficial to anyone in a practical manner at the moment. Maybe if you could share a specific hypothetical scenario where this makes sense, it would help me better understand. I am asking specifically in the context of what Jasonette is today. Maybe in the future it will grow into something where having its own content-type will be meaningful but today no Jasonette user has problem with the lack of content-type problem. They simply create a separate JSON endpoint for returning the JASON markup and that's that. Also regarding your comment on "a JASON representation of the same resource", but I am not sure this is the right way to think about this. For example if we think about a typical web app, it consists of Javascript files, CSS files, and an HTML document. When a website loads it makes several requests each with its own content-type ( Coming back to Jasonette, the power of Jasonette is it lets you describe equivalents of all of the above in JSON. We describe Overall, I feel like trying to categorize what Jasonette's markup is at this point will only constrain its potential going forward. But like I said, maybe I'm not seeing what you're seeing. Please let me know if I'm missing something. |
Hey everyone,
Here's something I've been willing to bring up but am just taking the time write now…
It is my understanding that Jasonette understands a very specific json format called
Jason
, correct?Assuming the above is true, what do you think about registering a media type with IANA? I'll list down some name options that come to mind as examples of what I mean and then I'll expand of the benefits of having a registered media type.
application/vnd.jason+json
(this would be my preference given the format name is Jason)application/vnd.jasonette+json
(kinda weird asjasonette
is the name of the "browser", not the format)There's a concept called content negotiation, where client and server can exchange information using the
Accept
andContent-Type
headers to communicate, respectively, what the client is able to understand (preferred format) and what the server responded with. This way we can have a single entry point into our systems, for examplehttps://example.com
, and serve different representations when possible. A normal web browser would hit the above URL withAccept=text/html
and we can simply respond with anHTML
representation of requested resource. Jasonette would hit it withAccept=application/vnd.jason+json
and we can simply respond with aJason
representation of that same resource.Using
application/json
on its own does provide any clues about format semantics. A media type, likeapplication/vnd.jason+json
tells clients that they can use a JSON parser (+json
) to read the contents and, together withvnd.jason
, use the dictionary (meaning) defined by theJason
format. Here's a somewhat recent Hacker News thread on the subject regarding a new json-based format someone created (quite lengthy though).On the client side, for example, Jasonette could implement (handle) different media types besides
Jason
, just like regular web browsers do when you follow aimage/png
resource, or even avideo/mp4
resource by understanding theContent-Type
and running the appropriate parser/renderer.Hope we can get a conversation started and move this forward!
The text was updated successfully, but these errors were encountered: