Skip to content

fix: do not split quoted key as path #270

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

Merged
merged 6 commits into from
Aug 16, 2023

Conversation

zmstone
Copy link
Member

@zmstone zmstone commented Aug 8, 2023

fixes #269

thalesmg
thalesmg previously approved these changes Aug 8, 2023
Copy link
Contributor

@thalesmg thalesmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding the following test case:

map_with_placeholders_test() ->
    RawConf =
        #{ <<"headers">> =>
               #{
                 <<"fixed_key">> => <<"fixed_value">>,
                 <<"${.payload.key}">> => <<"fixed_value">>,
                 <<"${.payload.key}2">> => <<"${.payload.value}">>,
                 <<"fixed_key2">> => <<"${.payload.value}">>
                }
         },
    TmpFile = "/tmp/" ++ atom_to_list(?FUNCTION_NAME) ++ ".conf",
    try
        ok = file:write_file(TmpFile, hocon_pp:do(RawConf, #{})),
        {ok, LoadedConf} = hocon:load(TmpFile, #{format => map}),
        ?assertEqual(RawConf, LoadedConf),
        ok
    after
        file:delete(TmpFile)
    end.

@zmstone zmstone force-pushed the do-not-split-dots-in-quoted-keys branch from ae68dc9 to 4bb6810 Compare August 14, 2023 12:23
thalesmg
thalesmg previously approved these changes Aug 14, 2023
@zmstone zmstone force-pushed the do-not-split-dots-in-quoted-keys branch from 4bb6810 to e9ff926 Compare August 14, 2023 13:12
@zmstone zmstone force-pushed the do-not-split-dots-in-quoted-keys branch from e9ff926 to b853884 Compare August 14, 2023 15:07
thalesmg
thalesmg previously approved these changes Aug 15, 2023
@zmstone zmstone merged commit b27423a into master Aug 16, 2023
@zmstone zmstone deleted the do-not-split-dots-in-quoted-keys branch August 16, 2023 08:28
@zmstone
Copy link
Member Author

zmstone commented Aug 16, 2023

tagged: 0.39.17

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 this pull request may close these issues.

Substitution-like strings in keys are parsed incorrectly
2 participants