Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing default value for qos field of API /clients/:clientid/subscribe #9703

Merged
merged 3 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/emqx_management/src/emqx_mgmt_api_clients.erl
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ fields(keepalive) ->
fields(subscribe) ->
[
{topic, hoconsc:mk(binary(), #{desc => <<"Topic">>})},
terry-xiaoyu marked this conversation as resolved.
Show resolved Hide resolved
{qos, hoconsc:mk(emqx_schema:qos(), #{desc => <<"QoS">>})},
{qos, hoconsc:mk(emqx_schema:qos(), #{default => 0, desc => <<"QoS">>})},
{nl, hoconsc:mk(integer(), #{default => 0, desc => <<"No Local">>})},
{rap, hoconsc:mk(integer(), #{default => 0, desc => <<"Retain as Published">>})},
{rh, hoconsc:mk(integer(), #{default => 0, desc => <<"Retain Handling">>})}
Expand Down
3 changes: 3 additions & 0 deletions changes/v5.0.14/fix-9703.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Set the default value of the `qos` field of the HTTP API `/clients/:clientid/subscribe` to 0.
Before this fix, the `qos` field have no default value, which leads to a `function_clause` error
when querying this API.
2 changes: 2 additions & 0 deletions changes/v5.0.14/fix-9703.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
将 HTTP 接口 `/clients/:clientid/subscribe` 的 `qos` 字段的默认值设置为 0。
在此修复之前,`qos` 字段没有默认值,调用订阅接口的时候将导致 `function_clause` 错误。