From 41aa958ac948e30fa4e2e908eeb07f8d07a735bc Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Sat, 11 Dec 2021 22:20:53 +0100 Subject: [PATCH] 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 --- apps/emqx_authn/src/emqx_authn_schema.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/emqx_authn/src/emqx_authn_schema.erl b/apps/emqx_authn/src/emqx_authn_schema.erl index c2e963ec4..7ec318803 100644 --- a/apps/emqx_authn/src/emqx_authn_schema.erl +++ b/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]),