4 ms·
No mention of IANA's link relations[1], OpenSearch[2] and Atom[3] which seems to cover almost anything and beyond what ‘HAL’ specifies. For JSON, JSONSchema sp
by deno 15y ago
No mention of IANA's link relations[1], OpenSearch[2] and Atom[3] which seems to cover almost anything and beyond what ‘HAL’ specifies.
For JSON, JSONSchema specifies standard way of including hyperlinks in a document, but of course no one, that uses JSON in the first place, even cares.
[1] http://www.iana.org/assignments/link-relations/link-relations.xml http://www.iana.org/assignments/link-relations/link-relation...
[2] http://www.opensearch.org/Home http://www.opensearch.org/Home
[3] RFC 4287, RFC 5023, RFC 4685, RFC 4946, RFC 5005
- arethuza 15y agoHaving pretty much sworn off XML, at least for my own projects, I've been pondering what JSON should look like that if you are going all the way to HATEOAS and you have links in your data returned from your REST interface.
- deno 15y agoYou will reinvent XML with uglier syntax, all while hurting yourself and Open Web. I've managed to somehow get into that argument before, so maybe there's something worth reading there: [1], [2]. [1] http://news.ycombinator.com/item?id=2623824 http://news.ycombinator.com/item?id=2623824 [2] http://news.ycombinator.com/item?id=2588606 http://news.ycombinator.com/item?id=2588606
- arethuza 15y agoDon't get me wrong - I'm not an XML hater by any means it's just that JSON appeals to be as a syntax - possibly as I did Lisp development for a number of years and the relative similarity of JSON to s-expressions appeals to me.
- deno 15y agoWell, I only care for public Web APIs. Though if you're not writing your documents by hand, I don't see how the syntax matters (it's just library then, anyway). And if you are writing your documents by hand, there are better solutions than JSON — for example YAML (which is excellent!).
- AffableSpatula 15y agoYep, it definitely should be making reference to the IANA registry (will likely do this by referencing Web Linking RFC5988). The point here was not to necessarily invent new capabilities, but to take a unique position in its design and bring together the most consistently useful assets of existing types whilst filtering out the noise. It's much healthier for the web than just returning plain JSON/XML or a custom media type.
- deno 15y agoIt's preferable to return correctly annotated (with elements from aforementioned namespaces) XML, rather than ‘plain XML.’ My point was, that this vocabulary already exists and there's no reason to invent new (incompatible) one. If you think you can provide some improvement to any of that, you should definitely contribute to that standards. It's great that you care about what you output at all. Most developers don't, some even try to embrace their ignorance. I think that there's certainly a lack of user-friendly resources, that introduce developers to the best practices regarding data formats and public APIs. For example, a website, that would catalogue and provide examples of usage of certain conventions, would be, undeniably, a godsend. I hope we can all make the Web a better place, and just adopting already defined standards would be a tremendous achievement!
- AffableSpatula 15y agoHAL already incorporates standards for the URI template spec and the CURIE syntax. It's also going to be rejigged to incorporate terminology direct from the Web Linking RFC. The above being the case, it doesn't seem as if HAL is re-inventing anything significant from a standards perspective, and avoids inheriting baggage associated with pulling in elements from other namespace. Perhaps not a completely 'pure' approach, but the primary objective is simplicty - and I think doing things this way is a good balance. If this is something you feel strongly about, please join the google group and raise it there so we can discuss merits and trade-offs in more depth.