From f8dd8d652dc584cc3fbd223557efbb82f9691efb Mon Sep 17 00:00:00 2001 From: Stefan Strigler Date: Fri, 2 Dec 2022 13:39:58 +0100 Subject: [PATCH] docs: add swagger error codes for /trace/:name/[log|download] --- apps/emqx_management/src/emqx_mgmt_api_trace.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/emqx_management/src/emqx_mgmt_api_trace.erl b/apps/emqx_management/src/emqx_mgmt_api_trace.erl index 466b0e82e..52a8c1040 100644 --- a/apps/emqx_management/src/emqx_mgmt_api_trace.erl +++ b/apps/emqx_management/src/emqx_mgmt_api_trace.erl @@ -140,7 +140,8 @@ schema("/trace/:name/download") -> 'application/octet-stream' => #{schema => #{type => "string", format => "binary"}} } - } + }, + 404 => emqx_dashboard_swagger:error_codes(['NOT_FOUND'], <<"Trace Name Not Found">>) } } }; @@ -174,7 +175,10 @@ schema("/trace/:name/log") -> [ {items, hoconsc:mk(binary(), #{example => "TEXT-LOG-ITEMS"})}, {meta, fields(bytes) ++ fields(position)} - ] + ], + 400 => emqx_dashboard_swagger:error_codes( + ['READ_FILE_ERROR', 'RPC_ERROR', 'NODE_ERROR'], <<"Trace Log Failed">> + ) } } }.