Skip to content

signals: Use DeepDiff-specific JSON serializer.

Charlie Turner requested to merge chturne/mars:cturner/deepdiff-serialize into master

JSONEncoder wasn't able to serialize a diff including type changes, which happens when a nullable field is added to a model (in this case, PDU to Machine). The JSONEncoder by default cannot serialize the <class 'type'>.

DeepDiff has a solution to this in which you should serialize the JSON using DeepDiff.to_json() rather than relying on the json.dumps doing auto-conversion. to_json() special-cases <class 'type'>.

Merge request reports

Loading