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

fix: add descriptions fields to bridge_v1

zhongwencool 2 лет назад
Родитель
Сommit
363055a32e

+ 4 - 1
apps/emqx_bridge/src/schema/emqx_bridge_schema.erl

@@ -124,7 +124,10 @@ common_bridge_fields() ->
                     desc => ?DESC("desc_enable"),
                     default => true
                 }
-            )}
+            )},
+        %% Create v2 connector then usr v1 /bridges_probe api to test connector
+        %% /bridges_probe should pass through v2 connector's description.
+        {description, emqx_schema:description_schema()}
     ].
 
 status_fields() ->

+ 7 - 0
apps/emqx_bridge/test/emqx_bridge_api_SUITE.erl

@@ -1047,6 +1047,13 @@ t_bridges_probe(Config) ->
         ?HTTP_BRIDGE(URL),
         Config
     ),
+    %% with descriptions is ok.
+    {ok, 204, <<>>} = request(
+        post,
+        uri(["bridges_probe"]),
+        (?HTTP_BRIDGE(URL))#{<<"description">> => <<"Test Description">>},
+        Config
+    ),
 
     ?assertMatch(
         {ok, 400, #{