Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Included substitution is inconsistent with Typesafe Config #68

Open
ghost opened this issue Sep 12, 2022 · 0 comments
Open

Included substitution is inconsistent with Typesafe Config #68

ghost opened this issue Sep 12, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 12, 2022

Per https://github.com/lightbend/config/blob/main/HOCON.md#includes :

Recall that substitution happens as a final step, after parsing. It should be done for the entire app's configuration, not for single files in isolation. Therefore, if an included file contains substitutions, they must be "fixed up" to be relative to the app's configuration root.

Maybe it's not 100% clear how this should be interpreted, but if we take these files:

main.conf:

include "included"

a = main

included.conf:

a = included
b = ${a}

And load main.conf, then Typesafe Config produces:

{
  "a": "main",
  "b": "main"
}

But hocon-rs 0.9.0:

{
  "a": "main",
  "b": "included"
}

hocon-rs sets b to main only if main.conf explicitly duplicates the assignment:

include "included"

a = main
b = ${a}

but that defeats the purpose of including files with default values.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants