Merge pull request #7742 from zhongwencool/schema-namespace

fix: add namespace to schema
This commit is contained in:
zhongwencool 2022-04-26 09:26:04 +08:00 committed by GitHub
commit 4b763a3a12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 6 deletions

View File

@ -102,7 +102,7 @@
-elvis([{elvis_style, god_modules, disable}]).
namespace() -> undefined.
namespace() -> broker.
roots() ->
%% TODO change config importance to a field metadata
@ -2219,7 +2219,7 @@ authentication(Desc) ->
undefined -> Default;
Module -> hoconsc:lazy(Module:root_type())
end,
desc_id => authentication_0,
desc_id => "authentication_0",
desc => iolist_to_binary([
Desc,
"\nAuthentication can be one single authenticator instance or a chain of "

View File

@ -64,7 +64,7 @@
emqx_slow_subs_schema
]).
namespace() -> undefined.
namespace() -> cluster.
roots() ->
PtKey = ?EMQX_AUTHENTICATION_SCHEMA_MODULE_PT_KEY,

View File

@ -22,7 +22,7 @@
-import(hoconsc, [mk/2, ref/2]).
-export([roots/0, fields/1, desc/1]).
-export([namespace/0, roots/0, fields/1, desc/1]).
-export([ get_response/0
, put_request/0
@ -51,6 +51,8 @@ http_schema(Method) ->
%%======================================================================================
%% Hocon Schema Definitions
namespace() -> connector.
roots() -> ["connectors"].
fields(connectors) -> fields("connectors");

View File

@ -21,7 +21,8 @@
-behaviour(hocon_schema).
-export([ roots/0
-export([ namespace/0
, roots/0
, fields/1
, desc/1
]).
@ -34,6 +35,8 @@
-import(emqx_schema, [mk_duration/2]).
namespace() -> "connector-mqtt".
roots() ->
fields("config").

View File

@ -24,7 +24,7 @@
desc/1
]).
namespace() -> <<"dashboard">>.
namespace() -> dashboard.
roots() -> ["dashboard"].
fields("dashboard") ->

View File

@ -22,12 +22,15 @@
-include_lib("hocon/include/hoconsc.hrl").
-export([
namespace/0,
roots/0,
fields/1
]).
-import(emqx_schema, [sc/2]).
namespace() -> "authn-psk".
roots() -> ["psk_authentication"].
fields("psk_authentication") ->