How do you link documents together in a JSON web service?
You can make up your own scheme by simply having some fields pointing to URLs like so:
{"name": "Fred","self": "http://example.com/fred"}
Or you could adopt something like Atom and JSONify it:
{ "name": "Fred", "link": { "href": "http://example.com/fred", "rel": "self" } }
This latter approach has been taken a step further by Mike Kelly with his Hypertext Application Language (HAL). http://stateless.co/hal_specification.html
- Login to Reply
There is no Objective-C library for HAL as yet. Would like a very simple library that lets you take an NSDictionary and convert it to a HAL resource.
+ (id)resourceFromDictionary:(NSDictionary *)dictionary;
This should return nil if there is a problem parsing the resource.
We may not get to this stage.