Nested interpolation lost when mixed inside string context
Summary
When using Himl’s (himl==0.15.2 from pip) nested interpolation ({{foo.bar}}) inside a longer string, the interpolation silences the surrounding text and resolves only to the raw value. But when using the same interpolation alone, it works correctly.
Steps to reproduce
-
Create
foo.yaml:foo: bar: 42 -
Create
baz.yaml:resources: test: type: example:Test properties: path: "hello {{foo.bar}} world" -
Run:
himl-config-merger foo.yaml baz.yaml > merged.yaml -
Expected in
merged.yaml:resources: test: properties: path: "hello 42 world" -
Actual result:
resources: test: properties: path: 42— The string collapses to just
42. -
Alternative case that does work:
path: "{{foo.bar}}"→ Correctly interpolates to:
path: 42
Any help would be much appreciated!
It appears the bug is here
If the value to interpolate is anything other than a string, it simply returns the value itself instead of doing line.replace
Thanks for reporting this issue! Would you also file a PR please?
Can do, I have a fork with this already, will clean and submit. Thanks!