refactor(emqx_connector): use `hocon_schema:override/2` to make pgsql 'username' field required

This commit is contained in:
Serge Tupchii 2023-09-01 19:07:23 +03:00
parent bc9b270308
commit ed9afe3345
1 changed files with 4 additions and 7 deletions

View File

@ -85,13 +85,10 @@ server() ->
adjust_fields(Fields) -> adjust_fields(Fields) ->
lists:map( lists:map(
fun fun
({username, OrigUsernameFn}) -> ({username, Sc}) ->
{username, fun %% to please dialyzer...
(required) -> Override = #{type => hocon_schema:field_schema(Sc, type), required => true},
true; {username, hocon_schema:override(Sc, Override)};
(Any) ->
OrigUsernameFn(Any)
end};
(Field) -> (Field) ->
Field Field
end, end,