Merge pull request #10195 from sstrigler/EMQX-8982-html-tags-are-displayed-in-http-api-doc
fix: add summary to schemas where description has html
This commit is contained in:
commit
4f63982d13
|
@ -438,7 +438,7 @@ schema("/nodes/:node/bridges/:id/:operation") ->
|
||||||
'operationId' => '/nodes/:node/bridges/:id/:operation',
|
'operationId' => '/nodes/:node/bridges/:id/:operation',
|
||||||
post => #{
|
post => #{
|
||||||
tags => [<<"bridges">>],
|
tags => [<<"bridges">>],
|
||||||
summary => <<"Stop/Restart bridge">>,
|
summary => <<"Stop/restart bridge">>,
|
||||||
description => ?DESC("desc_api8"),
|
description => ?DESC("desc_api8"),
|
||||||
parameters => [
|
parameters => [
|
||||||
param_path_node(),
|
param_path_node(),
|
||||||
|
|
|
@ -49,6 +49,10 @@ NOTE: The position should be \"front | rear | before:{name} | after:{name}"""
|
||||||
zh: """移动 Exhook 服务器顺序。
|
zh: """移动 Exhook 服务器顺序。
|
||||||
注意: 移动的参数只能是:front | rear | before:{name} | after:{name}"""
|
注意: 移动的参数只能是:front | rear | before:{name} | after:{name}"""
|
||||||
}
|
}
|
||||||
|
label {
|
||||||
|
en: "Change order of execution for registered Exhook server"
|
||||||
|
zh: "改变已注册的Exhook服务器的执行顺序"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
move_position {
|
move_position {
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
emqx_mgmt_api_publish {
|
emqx_mgmt_api_publish {
|
||||||
publish_api {
|
publish_api {
|
||||||
desc {
|
desc {
|
||||||
en: """Publish one message.<br/>
|
en: """Possible HTTP status response codes are:<br/>
|
||||||
Possible HTTP status response codes are:<br/>
|
|
||||||
<code>200</code>: The message is delivered to at least one subscriber;<br/>
|
<code>200</code>: The message is delivered to at least one subscriber;<br/>
|
||||||
<code>202</code>: No matched subscribers;<br/>
|
<code>202</code>: No matched subscribers;<br/>
|
||||||
<code>400</code>: Message is invalid. for example bad topic name, or QoS is out of range;<br/>
|
<code>400</code>: Message is invalid. for example bad topic name, or QoS is out of range;<br/>
|
||||||
|
@ -16,11 +15,14 @@ Possible HTTP status response codes are:<br/>
|
||||||
400: 消息编码错误,如非法主题,或 QoS 超出范围等。<br/>
|
400: 消息编码错误,如非法主题,或 QoS 超出范围等。<br/>
|
||||||
503: 服务重启等过程中导致转发失败。"""
|
503: 服务重启等过程中导致转发失败。"""
|
||||||
}
|
}
|
||||||
|
label {
|
||||||
|
en: "Publish a message"
|
||||||
|
zh: "发布一条信息"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
publish_bulk_api {
|
publish_bulk_api {
|
||||||
desc {
|
desc {
|
||||||
en: """Publish a batch of messages.<br/>
|
en: """Possible HTTP response status code are:<br/>
|
||||||
Possible HTTP response status code are:<br/>
|
|
||||||
200: All messages are delivered to at least one subscriber;<br/>
|
200: All messages are delivered to at least one subscriber;<br/>
|
||||||
202: At least one message was not delivered to any subscriber;<br/>
|
202: At least one message was not delivered to any subscriber;<br/>
|
||||||
400: At least one message is invalid. For example bad topic name, or QoS is out of range;<br/>
|
400: At least one message is invalid. For example bad topic name, or QoS is out of range;<br/>
|
||||||
|
@ -41,6 +43,10 @@ result of each individual message in the batch."""
|
||||||
<code>/publish</code> 是一样的。
|
<code>/publish</code> 是一样的。
|
||||||
如果所有的消息都是合法的,那么 HTTP 返回的内容是一个 JSON 数组,每个元素代表了该消息转发的状态。"""
|
如果所有的消息都是合法的,那么 HTTP 返回的内容是一个 JSON 数组,每个元素代表了该消息转发的状态。"""
|
||||||
}
|
}
|
||||||
|
label {
|
||||||
|
en: "Publish a batch of messages"
|
||||||
|
zh: "发布一批信息"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
topic_name {
|
topic_name {
|
||||||
|
|
|
@ -22,6 +22,10 @@ emqx_mgmt_api_status {
|
||||||
"GET `/status`端点(没有`/api/...`前缀)也是这个端点的一个别名,工作方式相同。"
|
"GET `/status`端点(没有`/api/...`前缀)也是这个端点的一个别名,工作方式相同。"
|
||||||
" 这个别名从v5.0.0开始就有了。"
|
" 这个别名从v5.0.0开始就有了。"
|
||||||
}
|
}
|
||||||
|
label {
|
||||||
|
en: "Service health check"
|
||||||
|
zh: "服务健康检查"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get_status_response200 {
|
get_status_response200 {
|
||||||
|
|
|
@ -119,6 +119,7 @@ schema("/configs_reset/:rootname") ->
|
||||||
"- For a config entry that has default value, this resets it to the default value;\n"
|
"- For a config entry that has default value, this resets it to the default value;\n"
|
||||||
"- For a config entry that has no default value, an error 400 will be returned"
|
"- For a config entry that has no default value, an error 400 will be returned"
|
||||||
>>,
|
>>,
|
||||||
|
summary => <<"Reset config entry">>,
|
||||||
%% We only return "200" rather than the new configs that has been changed, as
|
%% We only return "200" rather than the new configs that has been changed, as
|
||||||
%% the schema of the changed configs is depends on the request parameter
|
%% the schema of the changed configs is depends on the request parameter
|
||||||
%% `conf_path`, it cannot be defined here.
|
%% `conf_path`, it cannot be defined here.
|
||||||
|
|
|
@ -68,10 +68,10 @@ schema("/plugins") ->
|
||||||
#{
|
#{
|
||||||
'operationId' => list_plugins,
|
'operationId' => list_plugins,
|
||||||
get => #{
|
get => #{
|
||||||
|
summary => <<"List all installed plugins">>,
|
||||||
description =>
|
description =>
|
||||||
"List all install plugins.<br/>"
|
|
||||||
"Plugins are launched in top-down order.<br/>"
|
"Plugins are launched in top-down order.<br/>"
|
||||||
"Using `POST /plugins/{name}/move` to change the boot order.",
|
"Use `POST /plugins/{name}/move` to change the boot order.",
|
||||||
tags => ?TAGS,
|
tags => ?TAGS,
|
||||||
responses => #{
|
responses => #{
|
||||||
200 => hoconsc:array(hoconsc:ref(plugin))
|
200 => hoconsc:array(hoconsc:ref(plugin))
|
||||||
|
@ -82,8 +82,9 @@ schema("/plugins/install") ->
|
||||||
#{
|
#{
|
||||||
'operationId' => upload_install,
|
'operationId' => upload_install,
|
||||||
post => #{
|
post => #{
|
||||||
|
summary => <<"Install a new plugin">>,
|
||||||
description =>
|
description =>
|
||||||
"Install a plugin(plugin-vsn.tar.gz)."
|
"Upload a plugin tarball (plugin-vsn.tar.gz)."
|
||||||
"Follow [emqx-plugin-template](https://github.com/emqx/emqx-plugin-template) "
|
"Follow [emqx-plugin-template](https://github.com/emqx/emqx-plugin-template) "
|
||||||
"to develop plugin.",
|
"to develop plugin.",
|
||||||
tags => ?TAGS,
|
tags => ?TAGS,
|
||||||
|
@ -112,7 +113,8 @@ schema("/plugins/:name") ->
|
||||||
#{
|
#{
|
||||||
'operationId' => plugin,
|
'operationId' => plugin,
|
||||||
get => #{
|
get => #{
|
||||||
description => "Describe a plugin according `release.json` and `README.md`.",
|
summary => <<"Get a plugin description">>,
|
||||||
|
description => "Describs plugin according to its `release.json` and `README.md`.",
|
||||||
tags => ?TAGS,
|
tags => ?TAGS,
|
||||||
parameters => [hoconsc:ref(name)],
|
parameters => [hoconsc:ref(name)],
|
||||||
responses => #{
|
responses => #{
|
||||||
|
@ -121,7 +123,8 @@ schema("/plugins/:name") ->
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
delete => #{
|
delete => #{
|
||||||
description => "Uninstall a plugin package.",
|
summary => <<"Delete a plugin">>,
|
||||||
|
description => "Uninstalls a previously uploaded plugin package.",
|
||||||
tags => ?TAGS,
|
tags => ?TAGS,
|
||||||
parameters => [hoconsc:ref(name)],
|
parameters => [hoconsc:ref(name)],
|
||||||
responses => #{
|
responses => #{
|
||||||
|
@ -134,6 +137,7 @@ schema("/plugins/:name/:action") ->
|
||||||
#{
|
#{
|
||||||
'operationId' => update_plugin,
|
'operationId' => update_plugin,
|
||||||
put => #{
|
put => #{
|
||||||
|
summary => <<"Trigger action on an installed plugin">>,
|
||||||
description =>
|
description =>
|
||||||
"start/stop a installed plugin.<br/>"
|
"start/stop a installed plugin.<br/>"
|
||||||
"- **start**: start the plugin.<br/>"
|
"- **start**: start the plugin.<br/>"
|
||||||
|
@ -153,6 +157,7 @@ schema("/plugins/:name/move") ->
|
||||||
#{
|
#{
|
||||||
'operationId' => update_boot_order,
|
'operationId' => update_boot_order,
|
||||||
post => #{
|
post => #{
|
||||||
|
summary => <<"Move plugin within plugin hiearchy">>,
|
||||||
description => "Setting the boot order of plugins.",
|
description => "Setting the boot order of plugins.",
|
||||||
tags => ?TAGS,
|
tags => ?TAGS,
|
||||||
parameters => [hoconsc:ref(name)],
|
parameters => [hoconsc:ref(name)],
|
||||||
|
|
|
@ -50,6 +50,7 @@ schema("/publish") ->
|
||||||
#{
|
#{
|
||||||
'operationId' => publish,
|
'operationId' => publish,
|
||||||
post => #{
|
post => #{
|
||||||
|
summary => <<"Publish a message">>,
|
||||||
description => ?DESC(publish_api),
|
description => ?DESC(publish_api),
|
||||||
tags => [<<"Publish">>],
|
tags => [<<"Publish">>],
|
||||||
'requestBody' => hoconsc:mk(hoconsc:ref(?MODULE, publish_message)),
|
'requestBody' => hoconsc:mk(hoconsc:ref(?MODULE, publish_message)),
|
||||||
|
@ -65,6 +66,7 @@ schema("/publish/bulk") ->
|
||||||
#{
|
#{
|
||||||
'operationId' => publish_batch,
|
'operationId' => publish_batch,
|
||||||
post => #{
|
post => #{
|
||||||
|
summary => <<"Publish a batch of messages">>,
|
||||||
description => ?DESC(publish_bulk_api),
|
description => ?DESC(publish_bulk_api),
|
||||||
tags => [<<"Publish">>],
|
tags => [<<"Publish">>],
|
||||||
'requestBody' => hoconsc:mk(hoconsc:array(hoconsc:ref(?MODULE, publish_message)), #{}),
|
'requestBody' => hoconsc:mk(hoconsc:array(hoconsc:ref(?MODULE, publish_message)), #{}),
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Add labels to API schemas where description contains HTML and breaks formatting of generated documentation otherwise.
|
Loading…
Reference in New Issue