chore: make sure swagger's tags always titlecase 2

This commit is contained in:
Zhongwen Deng 2022-07-25 16:36:36 +08:00
parent cc63479e69
commit a3296078c3
10 changed files with 16 additions and 23 deletions

View File

@ -33,8 +33,8 @@
% Swagger
-define(API_TAGS_GLOBAL, [<<"authentication">>]).
-define(API_TAGS_SINGLE, [<<"listener authentication">>]).
-define(API_TAGS_GLOBAL, [<<"Authentication">>]).
-define(API_TAGS_SINGLE, [<<"Listener authentication">>]).
-export([
api_spec/0,

View File

@ -29,15 +29,8 @@
-define(NOT_FOUND, 'NOT_FOUND').
% Swagger
-define(API_TAGS_GLOBAL, [
?EMQX_AUTHENTICATION_CONFIG_ROOT_NAME_BINARY,
<<"authentication">>
]).
-define(API_TAGS_SINGLE, [
?EMQX_AUTHENTICATION_CONFIG_ROOT_NAME_BINARY,
<<"listener authentication">>
]).
-define(API_TAGS_GLOBAL, [<<"authentication">>]).
-define(API_TAGS_SINGLE, [<<"listener authentication">>]).
-export([
api_spec/0,

View File

@ -51,7 +51,7 @@ schema("/error_codes") ->
get => #{
security => [],
description => <<"API Error Codes">>,
tags => [<<"Error Codes">>],
tags => [<<"Error codes">>],
responses => #{
200 => hoconsc:array(hoconsc:ref(?MODULE, error_code))
}
@ -63,7 +63,7 @@ schema("/error_codes/:code") ->
get => #{
security => [],
description => <<"API Error Codes">>,
tags => [<<"Error Codes">>],
tags => [<<"Error codes">>],
parameters => [
{code,
hoconsc:mk(hoconsc:enum(emqx_dashboard_error_code:all()), #{

View File

@ -37,7 +37,7 @@ schema("/monitor") ->
#{
'operationId' => monitor,
get => #{
tags => [<<"metrics">>],
tags => [<<"Metrics">>],
desc => <<"List monitor data.">>,
parameters => [parameter_latest()],
responses => #{
@ -50,7 +50,7 @@ schema("/monitor/nodes/:node") ->
#{
'operationId' => monitor,
get => #{
tags => [<<"metrics">>],
tags => [<<"Metrics">>],
desc => <<"List the monitor data on the node.">>,
parameters => [parameter_node(), parameter_latest()],
responses => #{
@ -63,7 +63,7 @@ schema("/monitor_current") ->
#{
'operationId' => monitor_current,
get => #{
tags => [<<"metrics">>],
tags => [<<"Metrics">>],
desc => <<"Current status. Gauge and rate.">>,
responses => #{
200 => hoconsc:mk(hoconsc:ref(sampler_current), #{})
@ -74,7 +74,7 @@ schema("/monitor_current/nodes/:node") ->
#{
'operationId' => monitor_current,
get => #{
tags => [<<"metrics">>],
tags => [<<"Metrics">>],
desc => <<"Node current status. Gauge and rate.">>,
parameters => [parameter_node()],
responses => #{

View File

@ -48,7 +48,7 @@ schema(?PREFIX ++ "/request") ->
#{
operationId => request,
post => #{
tags => [<<"coap">>],
tags => [<<"CoAP gateway">>],
desc => ?DESC(send_coap_request),
parameters => request_parameters(),
requestBody => request_body(),

View File

@ -26,7 +26,7 @@
-export([alarms/2]).
-define(TAGS, [<<"alarms">>]).
-define(TAGS, [<<"Alarms">>]).
%% internal export (for query)
-export([query/4]).

View File

@ -50,7 +50,7 @@ schema("/stats") ->
get =>
#{
description => <<"EMQX stats">>,
tags => [<<"metrics">>],
tags => [<<"Metrics">>],
parameters => [ref(aggregate)],
responses =>
#{

View File

@ -31,7 +31,7 @@
-export([sys/2]).
-define(TAGS, [<<"system topics">>]).
-define(TAGS, [<<"System topics">>]).
namespace() -> "sys".

View File

@ -34,7 +34,7 @@
]).
-define(SCHEMA_MODULE, emqx_prometheus_schema).
-define(TAGS, [<<"monitor">>]).
-define(TAGS, [<<"Monitor">>]).
api_spec() ->
emqx_dashboard_swagger:spec(?MODULE, #{check_schema => true}).

View File

@ -32,7 +32,7 @@
schema/1
]).
-define(API_TAG_STATSD, [<<"monitor">>]).
-define(API_TAG_STATSD, [<<"Monitor">>]).
-define(SCHEMA_MODULE, emqx_statsd_schema).
-define(INTERNAL_ERROR, 'INTERNAL_ERROR').