pyhocon icon indicating copy to clipboard operation
pyhocon copied to clipboard

Possible breakage in substitition

Open vikrant-pune opened this issue 4 years ago • 1 comments

Hi,

I see difference in HOCON o/p vs pyhocon here is config

HOCON = Human-Optimized Config Object Notation
Default = [ { Name = Foo} ]
dev2= [{ Name = Foo2}]
dev3= [{ Name = Foo3}]
Default = ${Default}${dev3}
Default = ${Default}${dev2}

Output from https://hocon-playground.herokuapp.com/ is

{
    "Default" : [
        {
            "Name" : "Foo"
        },
        {
            "Name" : "Foo3"
        },
        {
            "Name" : "Foo2"
        }
    ],
    "HOCON" : "Human-Optimized Config Object Notation",
    "dev2" : [
        {
            "Name" : "Foo2"
        }
    ],
    "dev3" : [
        {
            "Name" : "Foo3"
        }
    ]
}

While Pyhocon fails with pyhocon.exceptions.ConfigSubstitutionException: Property Default cannot be substituted. Check for cycles.

vikrant-pune avatar Sep 10 '21 11:09 vikrant-pune

Actually, does not fail on the following:

HOCON = Human-Optimized Config Object Notation
Default = [ { Name = Foo} ]
dev2= [{ Name = Foo2}]
dev3= [{ Name = Foo3}]
Default = ${Default} ${dev3} ${dev2}

Strange

USSX-Hares avatar Sep 25 '22 17:09 USSX-Hares