Zaiming (Stone) Shi 2 лет назад
Родитель
Сommit
6c85e62d26

+ 1 - 1
apps/emqx_bridge_http/src/emqx_bridge_http_schema.erl

@@ -24,7 +24,7 @@
 
 
 %%======================================================================================
 %%======================================================================================
 %% Hocon Schema Definitions
 %% Hocon Schema Definitions
-namespace() -> "bridge_webhook".
+namespace() -> "bridge_http".
 
 
 roots() -> [].
 roots() -> [].
 
 

+ 3 - 1
apps/emqx_bridge_syskeeper/src/emqx_bridge_syskeeper_connector.erl

@@ -12,7 +12,7 @@
 -include_lib("snabbkaffe/include/snabbkaffe.hrl").
 -include_lib("snabbkaffe/include/snabbkaffe.hrl").
 -include_lib("hocon/include/hoconsc.hrl").
 -include_lib("hocon/include/hoconsc.hrl").
 
 
--export([roots/0, fields/1, desc/1, connector_examples/1]).
+-export([namespace/0, roots/0, fields/1, desc/1, connector_examples/1]).
 
 
 %% `emqx_resource' API
 %% `emqx_resource' API
 -export([
 -export([
@@ -44,6 +44,8 @@
 
 
 %% -------------------------------------------------------------------------------------------------
 %% -------------------------------------------------------------------------------------------------
 %% api
 %% api
+namespace() -> "syskeeper_forwarder".
+
 connector_examples(Method) ->
 connector_examples(Method) ->
     [
     [
         #{
         #{

+ 1 - 1
apps/emqx_conf/src/emqx_conf.erl

@@ -306,7 +306,7 @@ gen_flat_doc(RootNames, #{full_name := FullName, fields := Fields} = S) ->
     ShortName = short_name(FullName),
     ShortName = short_name(FullName),
     case is_missing_namespace(ShortName, to_bin(FullName), RootNames) of
     case is_missing_namespace(ShortName, to_bin(FullName), RootNames) of
         true ->
         true ->
-            io:format(standard_error, "WARN: no_namespace_for: ~s~n", [FullName]);
+            error({no_namespace, FullName, S});
         false ->
         false ->
             ok
             ok
     end,
     end,

+ 7 - 1
apps/emqx_gateway_gbt32960/src/emqx_gbt32960_schema.erl

@@ -4,12 +4,18 @@
 
 
 -module(emqx_gbt32960_schema).
 -module(emqx_gbt32960_schema).
 
 
+-behaviour(hocon_schema).
+
 -include("emqx_gbt32960.hrl").
 -include("emqx_gbt32960.hrl").
 -include_lib("hocon/include/hoconsc.hrl").
 -include_lib("hocon/include/hoconsc.hrl").
 -include_lib("typerefl/include/types.hrl").
 -include_lib("typerefl/include/types.hrl").
 
 
 %% config schema provides
 %% config schema provides
--export([fields/1, desc/1]).
+-export([namespace/0, roots/0, fields/1, desc/1]).
+
+namespace() -> "gateway_gbt32960".
+
+roots() -> [].
 
 
 fields(gbt32960) ->
 fields(gbt32960) ->
     [
     [

+ 5 - 1
apps/emqx_gateway_ocpp/src/emqx_ocpp_schema.erl

@@ -10,7 +10,11 @@
 -define(DEFAULT_MOUNTPOINT, <<"ocpp/">>).
 -define(DEFAULT_MOUNTPOINT, <<"ocpp/">>).
 
 
 %% config schema provides
 %% config schema provides
--export([fields/1, desc/1]).
+-export([namespace/0, roots/0, fields/1, desc/1]).
+
+namespace() -> "gateway_ocpp".
+
+roots() -> [].
 
 
 fields(ocpp) ->
 fields(ocpp) ->
     [
     [

+ 4 - 0
apps/emqx_postgresql/src/schema/emqx_postgresql_connector_schema.erl

@@ -24,6 +24,7 @@
 }).
 }).
 
 
 -export([
 -export([
+    namespace/0,
     roots/0,
     roots/0,
     fields/1,
     fields/1,
     desc/1
     desc/1
@@ -37,6 +38,9 @@
 
 
 -define(CONNECTOR_TYPE, pgsql).
 -define(CONNECTOR_TYPE, pgsql).
 
 
+namespace() ->
+    "connector_postgres".
+
 roots() ->
 roots() ->
     [].
     [].