Просмотр исходного кода

chore: make sure swagger's tags always titlecase 2

Zhongwen Deng 3 лет назад
Родитель
Сommit
a3296078c3

+ 2 - 2
apps/emqx_authn/src/emqx_authn_api.erl

@@ -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,

+ 2 - 9
apps/emqx_authn/src/emqx_authn_user_import_api.erl

@@ -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,

+ 2 - 2
apps/emqx_dashboard/src/emqx_dashboard_error_code_api.erl

@@ -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()), #{

+ 4 - 4
apps/emqx_dashboard/src/emqx_dashboard_monitor_api.erl

@@ -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 => #{

+ 1 - 1
apps/emqx_gateway/src/coap/emqx_coap_api.erl

@@ -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(),

+ 1 - 1
apps/emqx_management/src/emqx_mgmt_api_alarms.erl

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

+ 1 - 1
apps/emqx_management/src/emqx_mgmt_api_stats.erl

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

+ 1 - 1
apps/emqx_management/src/emqx_mgmt_api_sys.erl

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

+ 1 - 1
apps/emqx_prometheus/src/emqx_prometheus_api.erl

@@ -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}).

+ 1 - 1
apps/emqx_statsd/src/emqx_statsd_api.erl

@@ -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').