|
@@ -338,19 +338,20 @@ raw_conf_with_default(SchemaMod, RootNames, RawConf) ->
|
|
|
false ->
|
|
false ->
|
|
|
Acc;
|
|
Acc;
|
|
|
{_, {_, Schema}} ->
|
|
{_, {_, Schema}} ->
|
|
|
- Default =
|
|
|
|
|
- case hocon_schema:field_schema(Schema, type) of
|
|
|
|
|
- ?ARRAY(_) -> [];
|
|
|
|
|
- ?LAZY(?ARRAY(_)) -> [];
|
|
|
|
|
- _ -> #{}
|
|
|
|
|
- end,
|
|
|
|
|
- Acc#{Name => Default}
|
|
|
|
|
|
|
+ Acc#{Name => schema_default(Schema)}
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
end,
|
|
end,
|
|
|
RawDefault = lists:foldl(Fun, #{}, RootNames),
|
|
RawDefault = lists:foldl(Fun, #{}, RootNames),
|
|
|
maps:merge(RawConf, fill_defaults(SchemaMod, RawDefault, #{})).
|
|
maps:merge(RawConf, fill_defaults(SchemaMod, RawDefault, #{})).
|
|
|
|
|
|
|
|
|
|
+schema_default(Schema) ->
|
|
|
|
|
+ case hocon_schema:field_schema(Schema, type) of
|
|
|
|
|
+ ?ARRAY(_) -> [];
|
|
|
|
|
+ ?LAZY(?ARRAY(_)) -> [];
|
|
|
|
|
+ _ -> #{}
|
|
|
|
|
+ end.
|
|
|
|
|
+
|
|
|
parse_hocon(Conf) ->
|
|
parse_hocon(Conf) ->
|
|
|
IncDirs = include_dirs(),
|
|
IncDirs = include_dirs(),
|
|
|
case do_parse_hocon(Conf, IncDirs) of
|
|
case do_parse_hocon(Conf, IncDirs) of
|