Преглед изворни кода

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
Zaiming (Stone) Shi пре 4 година
родитељ
комит
41aa958ac9
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1 2
      apps/emqx_authn/src/emqx_authn_schema.erl

+ 1 - 2
apps/emqx_authn/src/emqx_authn_schema.erl

@@ -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]),