Explorar o código

fix(bridge): make direction defaults to egress if not provided

Shawn %!s(int64=4) %!d(string=hai) anos
pai
achega
1cd226c18b

+ 1 - 0
apps/emqx_bridge/src/emqx_bridge_http_schema.erl

@@ -87,6 +87,7 @@ basic_config() ->
     , {direction,
         mk(egress,
            #{ desc => "The direction of this bridge, MUST be egress"
+            , default => egress
             })}
     ]
     ++ proplists:delete(base_url, emqx_connector_http:fields(config)).

+ 1 - 0
apps/emqx_bridge/src/emqx_bridge_schema.erl

@@ -71,6 +71,7 @@ metrics_status_fields() ->
 direction_field(Dir, Desc) ->
     {direction, mk(Dir,
         #{ nullable => false
+         , default => egress
          , desc => "The direction of the bridge. Can be one of 'ingress' or 'egress'.<br>"
             ++ Desc
          })}.