splat
splat copied to clipboard
Handle merging (sub)segment lists in yaml merging
We support merging of multiple input yamls, but since segment and subsegments are lists, they won't properly be merged by the existing implementation of yaml merging.
Proposal: I think we need custom logic here in merge_configs:
# keys exist and match, see if a list to append
if type(main_config[curkey]) == list:
main_config[curkey] += additional_config[curkey]
inside that if, something like
if curkey in ["segments", "subsegments"]:
merge_segment_list(main_config[curkey], additional_config[curkey])
and then implement merge_segment_list so that it looks to see if segments in the additional config share a name with any in the main config. and if so, merge those with the same name, using merge_configs()