refactor(authn): root type as array of union

Deleted the wrapping union.
i.e. previously it's
union([union([...]), array(union([...]))]).
not it's
array(union([...]))

It is after-all a lazy type, and the dynamic check allows
single-elemented arrays not to have `[]` around it.

the old union of array of union schema was just adding confusion
This commit is contained in:
Zaiming (Stone) Shi 2021-12-11 22:20:53 +01:00
parent 7d36079f0a
commit 41aa958ac9
1 changed files with 1 additions and 2 deletions

View File

@ -50,8 +50,7 @@ config_refs(Modules) ->
%% in emqx_schema, 'authentication' is a map() type which is to allow
%% EMQ X more plugable.
root_type() ->
T = authenticator_type(),
hoconsc:union([T, hoconsc:array(T)]).
hoconsc:array(authenticator_type()).
mechanism(Name) ->
hoconsc:mk(hoconsc:enum([Name]),