Explorar o código

fix(mgmt_api): add missing error codes in schema

Erik Timan %!s(int64=3) %!d(string=hai) anos
pai
achega
28fc2b9ee9
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      apps/emqx_management/src/emqx_mgmt_api_subscriptions.erl

+ 5 - 1
apps/emqx_management/src/emqx_mgmt_api_subscriptions.erl

@@ -62,7 +62,11 @@ schema("/subscriptions") ->
             tags => [<<"Subscriptions">>],
             parameters => parameters(),
             responses => #{
-                200 => hoconsc:mk(hoconsc:array(hoconsc:ref(?MODULE, subscription)), #{})
+                200 => hoconsc:mk(hoconsc:array(hoconsc:ref(?MODULE, subscription)), #{}),
+                400 => emqx_dashboard_swagger:error_codes(
+                    ['INVALID_PARAMETER'], <<"Invalid parameter">>
+                ),
+                500 => emqx_dashboard_swagger:error_codes(['NODE_DOWN'], <<"Bad RPC">>)
             }
         }
     }.