Skip to content

Commit

Permalink
fix(hocon_schema): opts atom_key,return_plain not working for hocon_s…
Browse files Browse the repository at this point in the history
…chema:map/4
  • Loading branch information
terry-xiaoyu committed Jun 22, 2021
1 parent 243bb86 commit a46f0d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hocon_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a46f0d4

Please sign in to comment.