test(bridge): fix bridge map type filed converters

now the converters on map type fields only work at the wrapping map
level but not the values
This commit is contained in:
Zaiming (Stone) Shi 2023-04-30 10:45:11 +02:00
parent 03ae61569f
commit 57cc854a4a
2 changed files with 17 additions and 2 deletions

View File

@ -230,7 +230,12 @@ webhook_bridge_converter(Conf0, _HoconOpts) ->
undefined ->
undefined;
_ ->
do_convert_webhook_config(Conf1)
maps:map(
fun(_Name, Conf) ->
do_convert_webhook_config(Conf)
end,
Conf1
)
end.
do_convert_webhook_config(

View File

@ -181,7 +181,7 @@ kafka_structs() ->
#{
desc => <<"Kafka Producer Bridge Config">>,
required => false,
converter => fun emqx_bridge_kafka:kafka_producer_converter/2
converter => fun kafka_producer_converter/2
}
)},
{kafka_consumer,
@ -264,3 +264,13 @@ sqlserver_structs() ->
}
)}
].
kafka_producer_converter(undefined, _) ->
undefined;
kafka_producer_converter(Map, Opts) ->
maps:map(
fun(_Name, Config) ->
emqx_bridge_kafka:kafka_producer_converter(Config, Opts)
end,
Map
).