Skip to content

Commit

Permalink
preference the base model in merge_dicts except in skeleton mode (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
gblackadder authored Jan 29, 2025
1 parent 2c63676 commit c0dbdb6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pydantic_schemas/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,16 @@ def merge_dicts(base, update, skeleton_mode=False):
else:
new_dict[key] = base_value
else:
if update_value is not None:
new_dict[key] = update_value
if skeleton_mode:
if update_value is not None:
new_dict[key] = update_value
else:
new_dict[key] = base_value
else:
new_dict[key] = base_value
if base_value is None or base_value == "":
new_dict[key] = update_value
else:
new_dict[key] = base_value
else:
new_dict[key] = base_value
for key, update_value in update.items():
Expand Down

0 comments on commit c0dbdb6

Please sign in to comment.