소스 검색

Merge pull request #8140 from ieQu1/fix-dashboard-typerefl

fix(dashboard): Fix typing error
zhongwencool 3 년 전
부모
커밋
b3103a8701

+ 1 - 1
apps/emqx_dashboard/src/emqx_dashboard_swagger.erl

@@ -563,7 +563,7 @@ hocon_schema_to_spec(?R_REF(Module, StructName), _LocalModule) ->
 hocon_schema_to_spec(?REF(StructName), LocalModule) ->
     {#{<<"$ref">> => ?TO_COMPONENTS_SCHEMA(LocalModule, StructName)}, [{LocalModule, StructName}]};
 hocon_schema_to_spec(Type, LocalModule) when ?IS_TYPEREFL(Type) ->
-    {typename_to_spec(typerefl:name(Type), LocalModule), []};
+    {typename_to_spec(lists:flatten(typerefl:name(Type)), LocalModule), []};
 hocon_schema_to_spec(?ARRAY(Item), LocalModule) ->
     {Schema, Refs} = hocon_schema_to_spec(Item, LocalModule),
     {#{type => array, items => Schema}, Refs};

+ 3 - 0
apps/emqx_modules/test/emqx_rewrite_SUITE.erl

@@ -73,6 +73,9 @@ all() -> emqx_common_test_helpers:all(?MODULE).
 
 init_per_suite(Config) ->
     emqx_common_test_helpers:boot_modules(all),
+    ok = emqx_common_test_helpers:load_config(emqx_modules_schema, #{}, #{
+        raw_with_default => true
+    }),
     emqx_common_test_helpers:start_apps([emqx_conf, emqx_modules]),
     Config.
 

+ 1 - 1
apps/emqx_modules/test/emqx_topic_metrics_SUITE.erl

@@ -28,10 +28,10 @@ all() -> emqx_common_test_helpers:all(?MODULE).
 
 init_per_suite(Config) ->
     emqx_common_test_helpers:boot_modules(all),
-    emqx_common_test_helpers:start_apps([emqx_conf, emqx_modules]),
     ok = emqx_common_test_helpers:load_config(emqx_modules_schema, jsx:encode(?TOPIC), #{
         raw_with_default => true
     }),
+    emqx_common_test_helpers:start_apps([emqx_conf, emqx_modules]),
     Config.
 
 end_per_suite(_Config) ->