The original format used an "xpath"-like string when referencing
objects. This broke down when the objects it needed to
referenced lived inside of a list.
The new format is based on IDs which are sequentially assigned
during the object graph traversal. This is a much more robust
format and solves the problem of referencing into child lists
and saves us from having to invent a syntax for doing so.
This was motivated by issue #12:
...and other discussions about this topic in the past.
I made sure to keep backwards-compatibility so that jsonpickle
can still read json written by earlier versions of jsonpickle.
The new pickler, though, only writes the new format. This
will allow users to migrate to the new format seemlessly,
but they will need to be aware that only new clients can read
json written by the new version.
My pull request is here:
It'd be great to get some feedback about the new format.
I'm actually quite pleased with its simplicity.
Later work (namely, some of the more advanced stuff
where objects appear as keys) might be able to leverage
the work done here, hopefully.
Thanks for contributing this improvement! It looks good to me, I have
merged it into jsonpickle/master.
Grant & Eoghan, thanks for reporting the issue & providing test cases!
I bundled up the latest changes and just released 0.4.0 to pypi (sorry
for the long delay). If anyone notices any issues, let me know.
> You received this message because you are subscribed to the Google Groups "jsonpickle" group.
> To post to this group, send email to jsonp...@googlegroups.com.
> To unsubscribe from this group, send email to jsonpickle+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jsonpickle?hl=en.