chimpler / pyhocon

HOCON parser for Python
Apache License 2.0
508 stars 121 forks source link

Version 0.3.60 breaks setting default arguments in some cases #303

Open alex-gorin opened 1 year ago

alex-gorin commented 1 year ago

To reproduce, create the following files in the same directory: base.conf:

root: {
    nested_key: {
        var1: "var1_default"
        var1: ${?VAR1}

        var2: some_value
    }
}

test.conf:

include "base.conf"
root.nested_key.var2 = "another_value"

Run the command: cat test.conf | pyhocon -f json

Result for version 0.3.59 (expected):

{
  "root": {
    "nested_key": {
      "var1": "var1_default",
      "var2": "another_value"
    }
  }
}

Result for version 0.3.60 - not considering default value for var1 field:

{
  "root": {
    "nested_key": {
      "var1": null,
      "var2": "another_value"
    }
  }
}