fix: don't add default if root_key not found
This commit is contained in:
parent
8aa60cc0a5
commit
96baf4ccdb
|
@ -334,14 +334,18 @@ raw_conf_with_default(SchemaMod, RootNames, RawConf) ->
|
||||||
true ->
|
true ->
|
||||||
Acc;
|
Acc;
|
||||||
false ->
|
false ->
|
||||||
{_, {_, Schema}} = lists:keyfind(Name, 1, hocon_schema:roots(SchemaMod)),
|
case lists:keyfind(Name, 1, hocon_schema:roots(SchemaMod)) of
|
||||||
Default =
|
false ->
|
||||||
case hocon_schema:field_schema(Schema, type) of
|
Acc;
|
||||||
?ARRAY(_) -> [];
|
{_, {_, Schema}} ->
|
||||||
?LAZY(?ARRAY(_)) -> [];
|
Default =
|
||||||
_ -> #{}
|
case hocon_schema:field_schema(Schema, type) of
|
||||||
end,
|
?ARRAY(_) -> [];
|
||||||
Acc#{Name => Default}
|
?LAZY(?ARRAY(_)) -> [];
|
||||||
|
_ -> #{}
|
||||||
|
end,
|
||||||
|
Acc#{Name => Default}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
RawDefault = lists:foldl(Fun, #{}, RootNames),
|
RawDefault = lists:foldl(Fun, #{}, RootNames),
|
||||||
|
|
Loading…
Reference in New Issue