The discussion about !include
seems to lead a bit away from the actual question. Let's assume that in some unknown way, the !include
line gets replaced with the content in original.yml
. We would have:
array_in_yml:
- start: 1
- middle: 2
- end: 3
array_in_yml: []
This is not valid YAML, since every key in a dictionary must be unique, but you use the key array_in_yml
twice. Your YAML processor might ignore this and simply assign the first value (which is a sequence of three items) to the key array_in_yml
.
Now the important part: There is no way in YAML to modify previously given values. You cannot override a value given previously with a different one. What you want to do is outside the YAML spec and you would need some merging tool that does such replacements for you.