From 7d36079f0aeebe203c116c608d4cf708bea1cdd2 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Sat, 11 Dec 2021 22:17:52 +0100 Subject: [PATCH 1/2] docs(connector): better namespace for http schema --- apps/emqx_connector/src/emqx_connector_http.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/emqx_connector/src/emqx_connector_http.erl b/apps/emqx_connector/src/emqx_connector_http.erl index bae4e334b..0249d51b1 100644 --- a/apps/emqx_connector/src/emqx_connector_http.erl +++ b/apps/emqx_connector/src/emqx_connector_http.erl @@ -36,7 +36,9 @@ -export([ roots/0 , fields/1 - , validations/0]). + , validations/0 + , namespace/0 + ]). -export([ check_ssl_opts/2 ]). @@ -50,6 +52,9 @@ %%===================================================================== %% Hocon schema + +namespace() -> "connector-http". + roots() -> fields(config). From 41aa958ac948e30fa4e2e908eeb07f8d07a735bc Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Sat, 11 Dec 2021 22:20:53 +0100 Subject: [PATCH 2/2] 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]),