From a46f0d4fdc2827c79e389fa90a145079718ebba4 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Mon, 21 Jun 2021 20:01:44 +0800 Subject: [PATCH] fix(hocon_schema): opts atom_key,return_plain not working for hocon_schema:map/4 --- src/hocon_schema.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hocon_schema.erl b/src/hocon_schema.erl index 2cdeda8..14beb51 100644 --- a/src/hocon_schema.erl +++ b/src/hocon_schema.erl @@ -283,8 +283,7 @@ do_check(Schema, Conf, Opts0, RootNames) -> Opts = maps:merge(#{nullable => false}, Opts0), %% discard mappings for check APIs {_DiscardMappings, NewConf} = map(Schema, Conf, RootNames, Opts), - maybe_covert_keys_to_atom( - maybe_convert_to_plain_map(NewConf, Opts), Opts). + NewConf. maybe_convert_to_plain_map(Conf, #{is_richmap := true, return_plain := true}) -> richmap_to_map(Conf); @@ -333,7 +332,8 @@ map(Schema, Conf, RootNames, Opts0) -> {Mapped, NewConf} = lists:foldl(F, {[], Conf}, RootNames), ok = assert_no_error(Schema, Mapped), ok = assert_integrity(Schema, NewConf, Opts), - {Mapped, NewConf}. + {Mapped, maybe_covert_keys_to_atom( + maybe_convert_to_plain_map(NewConf, Opts), Opts)}. %% Assert no dot in root struct name. %% This is because the dot will cause root name to be splited,