lightbend / config

configuration library for JVM languages using HOCON files
https://lightbend.github.io/config/
6.17k stars 966 forks source link

Rendering a parsed config does not hold same results #805

Open sunnymoon opened 5 months ago

sunnymoon commented 5 months ago

When rendering a parsed ConfigObject, in a scenario where there is a configuration like

@config-file1.conf include file("values.conf") outer { include file("config-file2.conf") }

@config-file2.conf inner = ${value.url}

@values.conf value { url = "http://localhost" }

the rendered ConfigObject after just Parseable.newFile("config-file2.conf").parse() has:

value { url = "http://localhost" } outer { inner = ${ outer.value.url } }

instead of what was actually read :

value { url = "http://localhost" } outer { inner = ${ value.url } }

This means that if parsed back again and then later resolved, it will break because there is no outer.value.url. However, if resolved from the original file, it resolves correcly as inner=http://localhost (as expected).

lightbend-cla-validator commented 5 months ago

Hi @sunnymoon,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

http://www.lightbend.com/contribute/cla

sunnymoon commented 5 months ago

Hi @sunnymoon,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

http://www.lightbend.com/contribute/cla

Already signed

guerrillalg commented 2 months ago

@lightbend-cla-validator Any progress on this PR?