Selaa lähdekoodia

Merge pull request #11088 from fix/EMQX-10068/nicer-doc-tags

fix(ft-api): make schema tags look nicer in the docs
Andrew Mayorov 2 vuotta sitten
vanhempi
commit
af7b7ebf7c

+ 3 - 2
apps/emqx_ft/src/emqx_ft_api.erl

@@ -19,6 +19,7 @@
 
 -include_lib("typerefl/include/types.hrl").
 -include_lib("hocon/include/hoconsc.hrl").
+-include("emqx_ft_api.hrl").
 
 %% Swagger specs from hocon schema
 -export([
@@ -61,7 +62,7 @@ schema("/file_transfer/files") ->
     #{
         'operationId' => '/file_transfer/files',
         get => #{
-            tags => [<<"file_transfer">>],
+            tags => ?TAGS,
             summary => <<"List all uploaded files">>,
             description => ?DESC("file_list"),
             parameters => [
@@ -83,7 +84,7 @@ schema("/file_transfer/files/:clientid/:fileid") ->
     #{
         'operationId' => '/file_transfer/files/:clientid/:fileid',
         get => #{
-            tags => [<<"file_transfer">>],
+            tags => ?TAGS,
             summary => <<"List files uploaded in a specific transfer">>,
             description => ?DESC("file_list_transfer"),
             parameters => [

+ 10 - 0
apps/emqx_ft/src/emqx_ft_api.hrl

@@ -0,0 +1,10 @@
+%%--------------------------------------------------------------------
+%% Copyright (c) 2023 EMQ Technologies Co., Ltd. All Rights Reserved.
+%%--------------------------------------------------------------------
+
+-ifndef(__EMQX_FT_API__).
+-define(__EMQX_FT_API__, 42).
+
+-define(TAGS, [<<"File Transfer">>]).
+
+-endif.

+ 2 - 1
apps/emqx_ft/src/emqx_ft_storage_exporter_fs_api.erl

@@ -21,6 +21,7 @@
 -include_lib("typerefl/include/types.hrl").
 -include_lib("hocon/include/hoconsc.hrl").
 -include_lib("emqx/include/logger.hrl").
+-include("emqx_ft_api.hrl").
 
 %% Swagger specs from hocon schema
 -export([
@@ -60,7 +61,7 @@ schema("/file_transfer/file") ->
     #{
         'operationId' => '/file_transfer/file',
         get => #{
-            tags => [<<"file_transfer">>],
+            tags => ?TAGS,
             summary => <<"Download a particular file">>,
             description => ?DESC("file_get"),
             parameters => [