Open lexapi opened 6 years ago
I think I had a similar issue. I fixed it by passing marshal=True
to diff
.
I came here to report the same problem; I wonder if marshal=True
should be the default behavior? It seems surprising that the output of jsondiff.diff
is not itself JSON serializable.
I also came here for the same reason. I ended up implementing a hacky parser which switches the Symbols for strings, wish I'd know about marshal=True
.
The problem with having the insert
and delete
keywords as strings is that you can't tell them apart from a data structure with insert
and delete
as legitimate keys, so I can see the reasoning for making them symbols.
Perhaps a better longer term solution would be to adopt the output semantics of JSONPatch, which is completely unambigous, and is native JSON: http://jsonpatch.com/
Example: