@@ -143,7 +143,7 @@ def parse_diff(jdiff_evaluate_response, actual, intended, match_config):
143143 extra = {}
144144 missing = {}
145145
146- def process_diff (_map , extra_map , missing_map ):
146+ def process_diff (_map , extra_map , missing_map , previous_key = None ):
147147 for key , value in _map .items ():
148148 if isinstance (value , dict ) and "new_value" in value and "old_value" in value :
149149 extra_map [key ] = value ["old_value" ]
@@ -157,13 +157,13 @@ def process_diff(_map, extra_map, missing_map):
157157 set_nested_value (missing_map , key_chain [1 ::], new_value )
158158 elif isinstance (value , defaultdict ):
159159 if dict (value ).get ("new" ):
160- missing [key ] = dict (value ).get ("new" , {})
160+ missing [previous_key ][ key ] = dict (value ).get ("new" , {})
161161 if dict (value ).get ("missing" ):
162- extra_map [key ] = dict (value ).get ("missing" , {})
162+ extra_map [previous_key ][ key ] = dict (value ).get ("missing" , {})
163163 elif isinstance (value , dict ):
164164 extra_map [key ] = {}
165165 missing_map [key ] = {}
166- process_diff (value , extra_map [key ], missing_map [key ])
166+ process_diff (value , extra_map [key ], missing_map [key ], previous_key = key )
167167 return extra_map , missing_map
168168
169169 extras , missing = process_diff (jdiff_evaluate_response , extra , missing )
0 commit comments