diff --git a/apps/emqx/src/emqx_config.erl b/apps/emqx/src/emqx_config.erl index f0db4a275..ae108c595 100644 --- a/apps/emqx/src/emqx_config.erl +++ b/apps/emqx/src/emqx_config.erl @@ -338,19 +338,20 @@ raw_conf_with_default(SchemaMod, RootNames, RawConf) -> false -> Acc; {_, {_, 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, RawDefault = lists:foldl(Fun, #{}, RootNames), 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) -> IncDirs = include_dirs(), case do_parse_hocon(Conf, IncDirs) of