users@jersey.java.net

Re: [Jersey] XLink in Jersey

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Wed, 13 May 2009 11:29:41 -0700

2009/5/13 Felipe Gaścho <fgaucho_at_gmail.com>:
> very nice work from Brett, but then I started to evaluate the trend
> between formalism and service payload:
>
> so, using curl:
>
> curl -H "Accept:application/json" -X GET
> "http://fgaucho.dyndns.org:8080/hateoas4legacy/rs/countries/AU"
>
> {"links":{"link":[{"@rel":"","@type":"locator","@href":"http://fgaucho.dyndns.org:8080/hateoas4legacy/rs/cities/Brisbane"},{"@rel":"","@type":"locator","@href":"http://fgaucho.dyndns.org:8080/hateoas4legacy/rs/cities/Sydney"},{"@rel":"","@type":"locator","@href":"http://fgaucho.dyndns.org:8080/hateoas4legacy/rs/cities/Melbourne"},{"@rel":"","@type":"locator","@href":"http://fgaucho.dyndns.org:8080/hateoas4legacy/rs/countries/AU"}]},"cities":{"city":[{"links":null,"name":"Brisbane"},{"links":null,"name":"Sydney"},{"links":null,"name":"Melbourne"}]},"isoCode":"AU","name":"Australia"}
>
> seems too much data ... adherent to XML/XLink specification but
> perhaps too much verbose for JSON formats..

Yeah, well, XLink is strictly XML. JSON should have its own equivalent
IMO, and it makes lots of sense to use it as reference. But I really
dislike all these mapping conventions; they are like emulators ("run
your x86 windows apps on Mac"): needed, but not as good as the real
thing. :)

Btw, if anyone is interested, there are many json-related discussion
groups (not super active, but they are there), where things like this
are and should be discussed.

For example, "Restful JSON" list: http://groups.google.com/group/restful-json
sounds like a good place for discussing "hyperlinks for JSON" aspect.

-+ Tatu +-