Просмотр исходного кода

fix(connector): some desc for connector APIs

Shawn 4 лет назад
Родитель
Сommit
20091f8d2a

+ 3 - 3
apps/emqx_bridge/src/emqx_bridge_schema.erl

@@ -48,10 +48,10 @@ common_bridge_fields() ->
     , {connector,
         mk(binary(),
            #{ nullable => false
+            , example => <<"mqtt:my_mqtt_connector">>
             , desc =>"""
-The connector name to be used for this bridge.
-Connectors are configured as 'connectors.{type}.{name}',
-for example 'connectors.http.mybridge'.
+The connector Id to be used for this bridge. Connector Ids must be of format: '{type}:{name}'.<br>
+In config files, you can find the corresponding config entry for a connector by such path: 'connectors.{type}.{name}'.<br>
 """
             })}
     ].

+ 3 - 3
apps/emqx_connector/src/emqx_connector_api.erl

@@ -38,9 +38,9 @@
             _ = ConnName,
             EXPR
     catch
-        error:{invalid_bridge_id, Id0} ->
-            {400, #{code => 'INVALID_ID', message => <<"invalid_bridge_id: ", Id0/binary,
-                ". Bridge Ids must be of format {type}:{name}">>}}
+        error:{invalid_connector_id, Id0} ->
+            {400, #{code => 'INVALID_ID', message => <<"invalid_connector_id: ", Id0/binary,
+                ". Connector Ids must be of format {type}:{name}">>}}
     end).
 
 namespace() -> "connector".