deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

Handling of renames

Open ri0t opened this issue 8 years ago • 1 comments

For my migration system, one of the more often applied use cases is a rename of a dictionary key (which in jsonschema often is the name of an object's field), so what i get from that is:

{
    "dictionary_item_removed": {"root['properties']['obatzter']": {"description": "Custom user notes", "type": "string", "format": "html", "title": "User notes"}}, 
    "dictionary_item_added": {"root['properties']['apfelsalat']": {"description": "Custom user notes", "type": "string", "format": "html", "title": "User notes"}}
}

Where the fieldname "obatzter" was renamed to "apfelsalat". The above syntax is not so nice for migration, so I'd love to rather get a diff that says:

{
    "dictionary_item_renamed": {"root['properties']['obatzter']": "root['properties']['apfelsalat']"}
}

Might that please be possible?

ri0t avatar Jul 06 '17 18:07 ri0t

Hi @ri0t That is an interesting idea. Yes it should be doable. Let me think about how to implement it.

seperman avatar Aug 04 '17 21:08 seperman