-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
[Enhancement] Serializing using JSON referencing for referenced objects #32
Comments
If I understand the blog post correctly, this reference scheme would only work for dojo, or is this a general specification? |
You're right. According to Wikipedia (JSON article): "Object references This website has more info about it http://json-schema.org/. It seems to be encouraged by Sitepen (Dojo related). Here's the draft sent to IETF http://tools.ietf.org/html/draft-zyp-json-schema-03. But it seems to be expired (http://datatracker.ietf.org/doc/search/?name=json&rfcs=on&activeDrafts=on&oldDrafts=on&search_submit=), so I dont't know if it is actually worth or not to work on this... |
It definitely sounds interesting, something like this could be implemented using a custom property handler (which are not yet supported). I'm not sure when I'll have time for this, but patches are also welcome. |
Dojo guys should at least make the effort to make it an accepted extension of the standard similar to "merge key" |
err .. got confused there "merge key" is of course Yaml .. |
I'll close this for now. We can re-visit it when someone has time to prepare an implementation. |
Hi. I'm currently using Dojo for client side development, and it allows the use of JSON referencing between objects, in a REST context. It'd be great if the bundle allowed this behaviour, since it would simplify the treatment of objects (for example: no need to load a doctrine2 proxy class before serializing and less processing).
More info about JSON referencing: http://www.sitepen.com/blog/2008/06/17/json-referencing-in-dojo/
Possible example:
Object A properties: id and a reference to Object B
Object B properties: id and name
With normal serializing:
Serializing of object A: { id: 1, objectB: { id: 2, name: "myName" } }
Using JSON reference serializing:
Serializing of object A: { id: 1, objectB: { $ref: "/object_b/2" } }
The text was updated successfully, but these errors were encountered: