fix: placeholder & topic schema no default
This commit is contained in:
parent
b13ae50bed
commit
bafe5bae1c
|
@ -61,7 +61,7 @@ to_topic([Binary | PTs], C, Co, Res) when is_binary(Binary) ->
|
||||||
to_topic([clientid | PTs], C = #{clientid := ClientID}, Co, Res) ->
|
to_topic([clientid | PTs], C = #{clientid := ClientID}, Co, Res) ->
|
||||||
to_topic(PTs, C, Co, [ClientID | Res]);
|
to_topic(PTs, C, Co, [ClientID | Res]);
|
||||||
to_topic([username | PTs], C = #{username := undefined}, Co, Res) ->
|
to_topic([username | PTs], C = #{username := undefined}, Co, Res) ->
|
||||||
to_topic(PTs, C, Co, [<<"undefined">> | Res]);
|
to_topic(PTs, C, Co, [<<"${username}">> | Res]);
|
||||||
to_topic([username | PTs], C = #{username := Username}, Co, Res) ->
|
to_topic([username | PTs], C = #{username := Username}, Co, Res) ->
|
||||||
to_topic(PTs, C, Co, [Username | Res]);
|
to_topic(PTs, C, Co, [Username | Res]);
|
||||||
to_topic([host | PTs], C, Co = #{peername := {Host, _}}, Res) ->
|
to_topic([host | PTs], C, Co = #{peername := {Host, _}}, Res) ->
|
||||||
|
|
|
@ -29,6 +29,6 @@ fields("auto_subscribe") ->
|
||||||
[ {topics, hoconsc:array(hoconsc:ref(?MODULE, "topic"))}];
|
[ {topics, hoconsc:array(hoconsc:ref(?MODULE, "topic"))}];
|
||||||
|
|
||||||
fields("topic") ->
|
fields("topic") ->
|
||||||
[ {topic, emqx_schema:t(binary(), undefined, <<"">>)}
|
[ {topic, emqx_schema:t(binary())}
|
||||||
, {qos, emqx_schema:t(integer(), undefined, 0)}
|
, {qos, emqx_schema:t(integer(), undefined, 0)}
|
||||||
].
|
].
|
||||||
|
|
Loading…
Reference in New Issue