fix(schema): add roots for emqx_zone_schema

emqx_zone_schema is never used at root level, but for config doc
generation, it needs the roots.
This commit is contained in:
Zaiming Shi 2021-10-21 23:02:27 +02:00 committed by x1001100011
parent 0531a1925c
commit 54223e4fe6
2 changed files with 7 additions and 5 deletions

View File

@ -331,10 +331,7 @@ fields("mqtt") ->
];
fields("zone") ->
Fields = ["mqtt", "stats", "flapping_detect", "force_shutdown",
"conn_congestion", "rate_limit", "quota", "force_gc",
"overload_protection"
],
Fields = emqx_zone_schema:roots(),
[{F, ref(emqx_zone_schema, F)} || F <- Fields];
fields("rate_limit") ->

View File

@ -20,7 +20,12 @@
namespace() -> zone.
roots() -> [].
%% this shcema module is not used at root level.
%% roots are added only for document generation.
roots() -> ["mqtt", "stats", "flapping_detect", "force_shutdown",
"conn_congestion", "rate_limit", "quota", "force_gc",
"overload_protection"
].
%% zone schemas are clones from the same name from root level
%% only not allowed to have default values.