Merge pull request #11729 from zhongwencool/api-tags-fix

docs: swagger api tags should camel case
This commit is contained in:
zhongwencool 2023-10-09 03:18:46 -05:00 committed by GitHub
commit 363d073b85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 27 additions and 22 deletions

View File

@ -1,6 +1,6 @@
{application, emqx_eviction_agent, [ {application, emqx_eviction_agent, [
{description, "EMQX Eviction Agent"}, {description, "EMQX Eviction Agent"},
{vsn, "5.1.3"}, {vsn, "5.1.4"},
{registered, [ {registered, [
emqx_eviction_agent_sup, emqx_eviction_agent_sup,
emqx_eviction_agent, emqx_eviction_agent,

View File

@ -23,6 +23,8 @@
roots/0 roots/0
]). ]).
-define(TAGS, [<<"Node Eviction">>]).
%% API callbacks %% API callbacks
-export([ -export([
'/node_eviction/status'/2 '/node_eviction/status'/2
@ -44,7 +46,7 @@ schema("/node_eviction/status") ->
#{ #{
'operationId' => '/node_eviction/status', 'operationId' => '/node_eviction/status',
get => #{ get => #{
tags => [<<"node_eviction">>], tags => ?TAGS,
summary => <<"Get node eviction status">>, summary => <<"Get node eviction status">>,
description => ?DESC("node_eviction_status_get"), description => ?DESC("node_eviction_status_get"),
responses => #{ responses => #{

View File

@ -1,6 +1,6 @@
{application, emqx_ft, [ {application, emqx_ft, [
{description, "EMQX file transfer over MQTT"}, {description, "EMQX file transfer over MQTT"},
{vsn, "0.1.7"}, {vsn, "0.1.8"},
{registered, []}, {registered, []},
{mod, {emqx_ft_app, []}}, {mod, {emqx_ft_app, []}},
{applications, [ {applications, [

View File

@ -110,7 +110,7 @@ schema("/file_transfer") ->
#{ #{
'operationId' => '/file_transfer', 'operationId' => '/file_transfer',
get => #{ get => #{
tags => [<<"file_transfer">>], tags => ?TAGS,
summary => <<"Get current File Transfer configuration">>, summary => <<"Get current File Transfer configuration">>,
description => ?DESC("file_transfer_get_config"), description => ?DESC("file_transfer_get_config"),
responses => #{ responses => #{
@ -118,7 +118,7 @@ schema("/file_transfer") ->
} }
}, },
put => #{ put => #{
tags => [<<"file_transfer">>], tags => ?TAGS,
summary => <<"Update File Transfer configuration">>, summary => <<"Update File Transfer configuration">>,
description => ?DESC("file_transfer_update_config"), description => ?DESC("file_transfer_update_config"),
'requestBody' => ?SCHEMA_CONFIG, 'requestBody' => ?SCHEMA_CONFIG,

View File

@ -1,6 +1,6 @@
{application, emqx_node_rebalance, [ {application, emqx_node_rebalance, [
{description, "EMQX Node Rebalance"}, {description, "EMQX Node Rebalance"},
{vsn, "5.0.5"}, {vsn, "5.0.6"},
{registered, [ {registered, [
emqx_node_rebalance_sup, emqx_node_rebalance_sup,
emqx_node_rebalance, emqx_node_rebalance,

View File

@ -50,6 +50,7 @@
-define(NODE_EVACUATING, 'NODE_EVACUATING'). -define(NODE_EVACUATING, 'NODE_EVACUATING').
-define(RPC_ERROR, 'RPC_ERROR'). -define(RPC_ERROR, 'RPC_ERROR').
-define(NOT_FOUND, 'NOT_FOUND'). -define(NOT_FOUND, 'NOT_FOUND').
-define(TAGS, [<<"Load Rebalance">>]).
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% API Spec %% API Spec
@ -78,7 +79,7 @@ schema("/load_rebalance/status") ->
#{ #{
'operationId' => '/load_rebalance/status', 'operationId' => '/load_rebalance/status',
get => #{ get => #{
tags => [<<"load_rebalance">>], tags => ?TAGS,
summary => <<"Get rebalance status">>, summary => <<"Get rebalance status">>,
description => ?DESC("load_rebalance_status"), description => ?DESC("load_rebalance_status"),
responses => #{ responses => #{
@ -90,7 +91,7 @@ schema("/load_rebalance/global_status") ->
#{ #{
'operationId' => '/load_rebalance/global_status', 'operationId' => '/load_rebalance/global_status',
get => #{ get => #{
tags => [<<"load_rebalance">>], tags => ?TAGS,
summary => <<"Get global rebalance status">>, summary => <<"Get global rebalance status">>,
description => ?DESC("load_rebalance_global_status"), description => ?DESC("load_rebalance_global_status"),
responses => #{ responses => #{
@ -102,7 +103,7 @@ schema("/load_rebalance/availability_check") ->
#{ #{
'operationId' => '/load_rebalance/availability_check', 'operationId' => '/load_rebalance/availability_check',
get => #{ get => #{
tags => [<<"load_rebalance">>], tags => ?TAGS,
summary => <<"Node rebalance availability check">>, summary => <<"Node rebalance availability check">>,
description => ?DESC("load_rebalance_availability_check"), description => ?DESC("load_rebalance_availability_check"),
responses => #{ responses => #{
@ -115,7 +116,7 @@ schema("/load_rebalance/:node/start") ->
#{ #{
'operationId' => '/load_rebalance/:node/start', 'operationId' => '/load_rebalance/:node/start',
post => #{ post => #{
tags => [<<"load_rebalance">>], tags => ?TAGS,
summary => <<"Start rebalancing with the node as coordinator">>, summary => <<"Start rebalancing with the node as coordinator">>,
description => ?DESC("load_rebalance_start"), description => ?DESC("load_rebalance_start"),
parameters => [param_node()], parameters => [param_node()],
@ -135,7 +136,7 @@ schema("/load_rebalance/:node/stop") ->
#{ #{
'operationId' => '/load_rebalance/:node/stop', 'operationId' => '/load_rebalance/:node/stop',
post => #{ post => #{
tags => [<<"load_rebalance">>], tags => ?TAGS,
summary => <<"Stop rebalancing coordinated by the node">>, summary => <<"Stop rebalancing coordinated by the node">>,
description => ?DESC("load_rebalance_stop"), description => ?DESC("load_rebalance_stop"),
parameters => [param_node()], parameters => [param_node()],
@ -150,7 +151,7 @@ schema("/load_rebalance/:node/evacuation/start") ->
#{ #{
'operationId' => '/load_rebalance/:node/evacuation/start', 'operationId' => '/load_rebalance/:node/evacuation/start',
post => #{ post => #{
tags => [<<"load_rebalance">>], tags => ?TAGS,
summary => <<"Start evacuation on a node">>, summary => <<"Start evacuation on a node">>,
description => ?DESC("load_rebalance_evacuation_start"), description => ?DESC("load_rebalance_evacuation_start"),
parameters => [param_node()], parameters => [param_node()],
@ -170,7 +171,7 @@ schema("/load_rebalance/:node/evacuation/stop") ->
#{ #{
'operationId' => '/load_rebalance/:node/evacuation/stop', 'operationId' => '/load_rebalance/:node/evacuation/stop',
post => #{ post => #{
tags => [<<"load_rebalance">>], tags => ?TAGS,
summary => <<"Stop evacuation on a node">>, summary => <<"Stop evacuation on a node">>,
description => ?DESC("load_rebalance_evacuation_stop"), description => ?DESC("load_rebalance_evacuation_stop"),
parameters => [param_node()], parameters => [param_node()],
@ -186,7 +187,7 @@ schema("/load_rebalance/:node/evacuation/stop") ->
%% #{ %% #{
%% 'operationId' => '/load_rebalance/:node/purge/start', %% 'operationId' => '/load_rebalance/:node/purge/start',
%% post => #{ %% post => #{
%% tags => [<<"load_rebalance">>], %% tags => ?TAGS,
%% summary => <<"Start purge on the whole cluster">>, %% summary => <<"Start purge on the whole cluster">>,
%% description => ?DESC("cluster_purge_start"), %% description => ?DESC("cluster_purge_start"),
%% parameters => [param_node()], %% parameters => [param_node()],
@ -206,7 +207,7 @@ schema("/load_rebalance/:node/evacuation/stop") ->
%% #{ %% #{
%% 'operationId' => '/load_rebalance/:node/purge/stop', %% 'operationId' => '/load_rebalance/:node/purge/stop',
%% post => #{ %% post => #{
%% tags => [<<"load_rebalance">>], %% tags => ?TAGS,
%% summary => <<"Stop purge on the whole cluster">>, %% summary => <<"Stop purge on the whole cluster">>,
%% description => ?DESC("cluster_purge_stop"), %% description => ?DESC("cluster_purge_stop"),
%% parameters => [param_node()], %% parameters => [param_node()],

View File

@ -1,6 +1,6 @@
{application, emqx_schema_registry, [ {application, emqx_schema_registry, [
{description, "EMQX Schema Registry"}, {description, "EMQX Schema Registry"},
{vsn, "0.1.6"}, {vsn, "0.1.7"},
{registered, [emqx_schema_registry_sup]}, {registered, [emqx_schema_registry_sup]},
{mod, {emqx_schema_registry_app, []}}, {mod, {emqx_schema_registry_app, []}},
{included_applications, [ {included_applications, [

View File

@ -22,6 +22,8 @@
'/schema_registry/:name'/2 '/schema_registry/:name'/2
]). ]).
-define(TAGS, [<<"Schema Registry">>]).
%%------------------------------------------------------------------------------------------------- %%-------------------------------------------------------------------------------------------------
%% `minirest' and `minirest_trails' API %% `minirest' and `minirest_trails' API
%%------------------------------------------------------------------------------------------------- %%-------------------------------------------------------------------------------------------------
@ -41,7 +43,7 @@ schema("/schema_registry") ->
#{ #{
'operationId' => '/schema_registry', 'operationId' => '/schema_registry',
get => #{ get => #{
tags => [<<"schema_registry">>], tags => ?TAGS,
summary => <<"List registered schemas">>, summary => <<"List registered schemas">>,
description => ?DESC("desc_schema_registry_api_list"), description => ?DESC("desc_schema_registry_api_list"),
responses => responses =>
@ -57,7 +59,7 @@ schema("/schema_registry") ->
} }
}, },
post => #{ post => #{
tags => [<<"schema_registry">>], tags => ?TAGS,
summary => <<"Register a new schema">>, summary => <<"Register a new schema">>,
description => ?DESC("desc_schema_registry_api_post"), description => ?DESC("desc_schema_registry_api_post"),
'requestBody' => emqx_dashboard_swagger:schema_with_examples( 'requestBody' => emqx_dashboard_swagger:schema_with_examples(
@ -79,7 +81,7 @@ schema("/schema_registry/:name") ->
#{ #{
'operationId' => '/schema_registry/:name', 'operationId' => '/schema_registry/:name',
get => #{ get => #{
tags => [<<"schema_registry">>], tags => ?TAGS,
summary => <<"Get registered schema">>, summary => <<"Get registered schema">>,
description => ?DESC("desc_schema_registry_api_get"), description => ?DESC("desc_schema_registry_api_get"),
parameters => [param_path_schema_name()], parameters => [param_path_schema_name()],
@ -94,7 +96,7 @@ schema("/schema_registry/:name") ->
} }
}, },
put => #{ put => #{
tags => [<<"schema_registry">>], tags => ?TAGS,
summary => <<"Update a schema">>, summary => <<"Update a schema">>,
description => ?DESC("desc_schema_registry_api_put"), description => ?DESC("desc_schema_registry_api_put"),
parameters => [param_path_schema_name()], parameters => [param_path_schema_name()],
@ -113,7 +115,7 @@ schema("/schema_registry/:name") ->
} }
}, },
delete => #{ delete => #{
tags => [<<"schema_registry">>], tags => ?TAGS,
summary => <<"Delete registered schema">>, summary => <<"Delete registered schema">>,
description => ?DESC("desc_schema_registry_api_delete"), description => ?DESC("desc_schema_registry_api_delete"),
parameters => [param_path_schema_name()], parameters => [param_path_schema_name()],

View File

@ -41,7 +41,7 @@ license(_) ->
emqx_ctl:usage( emqx_ctl:usage(
[ [
{"license info", "Show license info"}, {"license info", "Show license info"},
{"license update License", "Update license given as a string"} {"license update <License>", "Update license given as a string"}
] ]
). ).