Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is the perfect case for hypermedia in the RESTful sense.

Rich Hickey recently gave one of his talks[1] where at one point he offhandedly mentioned that hypermedia (which gives URIs for related HTTP resources, with some link-like metadata) doesn't make sense for APIs because APIs don't have human "drivers" that can read the link text and make meaningful sense of what relations actually mean in the domain model.

I think the genius of RESTful hypermedia, though, could really come through in a system like this. How else do you show relations? Last time I checked, RailsAdmin can't do much for you here except provide the resource ID as a link to that resource's table and row.

As a benign example, imagine a guest-party admin page. What today would look like "Guest: 'Pitt, Brad', Party: '43'", tomorrow could be be "Guest: 'Pitt, Brad', Party: 'Pitt-Jolie'" with a link to '/parties/43'.

I sense that developers (or at least Crockford[2]?) don't want JSON to become overloaded with XML equivalents like XML schemas and metaschemas and XSLT...but think of what we could do!

[1] http://www.youtube.com/watch?v=ROor6_NGIWU

[2] http://www.infoq.com/presentations/Heretical-Open-Source ?



Json-ld takes this even further, it also supports linking data across multiple domains.

http://json-ld.org/


I'll also mention HAL, which is spec'd in both JSON and XML and has been serving me quite well.

http://stateless.co/hal_specification.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: