|
|
@@ -499,15 +499,14 @@ fill_defaults(RawConf, Opts) ->
|
|
|
).
|
|
|
|
|
|
-spec fill_defaults(module(), raw_config(), hocon_tconf:opts()) -> map().
|
|
|
-fill_defaults(_SchemaMod, RawConf = #{<<"durable_storage">> := _}, _) ->
|
|
|
+fill_defaults(SchemaMod, RawConf = #{<<"durable_storage">> := Ds}, Opts) ->
|
|
|
%% FIXME: kludge to prevent `emqx_config' module from filling in
|
|
|
%% the default values for backends and layouts. These records are
|
|
|
%% inside unions, and adding default values there will add
|
|
|
%% incompatible fields.
|
|
|
- %%
|
|
|
- %% Note: this function is called for each individual conf root, so
|
|
|
- %% this clause only affects this particular subtree.
|
|
|
- RawConf;
|
|
|
+ RawConf1 = maps:remove(<<"durable_storage">>, RawConf),
|
|
|
+ Conf = fill_defaults(SchemaMod, RawConf1, Opts),
|
|
|
+ Conf#{<<"durable_storage">> => Ds};
|
|
|
fill_defaults(SchemaMod, RawConf, Opts0) ->
|
|
|
Opts = maps:merge(#{required => false, make_serializable => true}, Opts0),
|
|
|
hocon_tconf:check_plain(
|