Skip to content
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

JSON - Hypermedia or references support? #87

Open
bclozel opened this issue Dec 5, 2012 · 1 comment
Open

JSON - Hypermedia or references support? #87

bclozel opened this issue Dec 5, 2012 · 1 comment
Milestone

Comments

@bclozel
Copy link
Contributor

bclozel commented Dec 5, 2012

See issue resthub/resthub-spring-stack#45 for the server part.

How should we consider support for:

  • JSON references - (de)serializing object graphs and preventing duplication or circular references, using references.
  • Hypermedia - adding metadata to serialized objects to allow lazy loading through additional API calls on the client side.

We should consider only one of those options.

JSON reference

On the client side, several libs achieved this:

There are problems on the server side: Jackson doesn't support the json-ref syntax "$ref" and only relies on having typed objects on both client/server sides (see ObjectIdentity).

There are also problems on the client side; javascript client libs duplicate data, i.e. they expand the object graph with their values. This can be problematic when updating data on the client side.

Hypermedia

We could consider HAL and/or json-ld formats and integrate those on the client side for lazy-loading and metadata.

We could integrate those within backbone using:

Of course, I'm all for Hypermedia!

@manosbatsis
Copy link

Regarding references, why not use Jackson's @JsonIdentityInfo[1]? It just works as far as the spring stack goes, but needs support on the backbone stack side. Perhaps something as simple as an identity map [2]. I'd surely vote for this as a core resthub feature.

[1] http://wiki.fasterxml.com/JacksonFeatureObjectIdentity
[2] http://blog.shinetech.com/2012/12/24/an-identity-map-for-backbone-js/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants