Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array is not being substituted correctly #127

Closed
nareshj09 opened this issue Nov 14, 2019 · 2 comments · Fixed by #138
Closed

Array is not being substituted correctly #127

nareshj09 opened this issue Nov 14, 2019 · 2 comments · Fixed by #138
Milestone

Comments

@nareshj09
Copy link

Parsing this using akkadotnet

    c: {
        q: {
            𝗮: [𝟮, 𝟱]
        }
    }
    c: {
        m: ${c.q} {a: [6]}
    }

Results in:
(c.q.a should has changed)

    {
        c : {
            q : {
                𝗮 : [𝟲]
            },
            m : {
                a : [6]
            }
        }
    }

EXPECTED:
c.q.a should be unchanged

    {
        c : {
            q : {
                𝗮 : [𝟮, 𝟱]
            },
            m : {
                a : [6]
            }
        }
    }
@Aaronontheweb Aaronontheweb added this to the HOCON v1.2.1 milestone Nov 28, 2019
@IgorFedchenko
Copy link
Contributor

Seems like this is not only related to arrays.
I.e. for this config:

c: {
    q: {
        a: 1
    }
}
c: {
    m: ${c.q} {a: 2}
}

It is also rewriting c.q.a to 2, but should not.
Seems like whenever there is a concatenation with substitution, we have to make full copy of substituted value to make it change safely.

@IgorFedchenko
Copy link
Contributor

Interesting fact is that with the following config it works correctly:

c: {
    q: {
        a: [2, 5]
    }
    m: ${c.q} {a: [6]}
}

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

Successfully merging a pull request may close this issue.

3 participants