Skip Menu |

This queue is for tickets about the YAML-Syck CPAN distribution.

Report information
The Basics
Id: 18081
Status: resolved
Priority: 0/
Queue: YAML-Syck

People
Owner: Nobody in particular
Requestors: CRAKRJACK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: JSON-RPC class identification support
The JSON-RPC spec (http://www.json-rpc.org/) contains the following provision to serialize class information: ---snip-- 3. JSON Class hinting There are only simple data types defined in JSON. To overcome this problem in a JSON compatible way a special property for objects is introduced. {"__jsonclass__":["constructor", [param1, ], "prop1": ...} The object is then instantiated using the constructor, passing in the parameters. Once constructed the properties (prop1, ...) will be applied. ---snip--- I would like to see JSON::Syck be able to handle this. Perhaps the ability to define two callbacks. 1) During dumping, given a blessed reference, get the [ "constructor", param ] args back. 2) During loading, given when a hash where the __jsonclass__ key is found, pass that hashref into a callback and get an object back. I think this would help address any naming convention/security/implementation concerns and leave it as open as possible. Does libsyck/JSON::Syck currently tackle structures depth-first? Thanks, Tyler
Ticket migrated to github as https://github.com/toddr/YAML-Syck/issues/20