docs(emqx_rule_api apply rule): fix doc strings

This commit is contained in:
Kjell Winblad 2024-04-08 15:34:29 +02:00
parent 600526a0e4
commit 9628a00a82
6 changed files with 23 additions and 8 deletions

View File

@ -117,7 +117,7 @@ fields("rule_apply_test") ->
default => #{}
}
)},
{"stop_action_after_template_render",
{"stop_action_after_template_rendering",
sc(
typerefl:boolean(),
#{

View File

@ -268,8 +268,8 @@ schema("/rules/:id/test") ->
'operationId' => '/rules/:id/test',
post => #{
tags => [<<"rules">>],
description => ?DESC("api8"),
summary => <<"Apply a rule with the given message and environment">>,
description => ?DESC("api11"),
summary => <<"Apply a rule for testing">>,
'requestBody' => rule_apply_test_schema(),
responses => #{
400 => error_schema('BAD_REQUEST', "Invalid Parameters"),

View File

@ -29,7 +29,7 @@ apply_rule(
#{
context := Context,
environment := Env,
stop_action_after_template_render := StopAfterRender
stop_action_after_template_rendering := StopAfterRender
}
) ->
{ok, Rule} = emqx_rule_engine:get_rule(RuleId),

View File

@ -30,9 +30,6 @@ all() ->
init_per_suite(Config) ->
application:load(emqx_conf),
% ok = emqx_common_test_helpers:load_config(emqx_rule_engine_schema, ?CONF_DEFAULT),
% ok = emqx_common_test_helpers:start_apps([emqx_conf, emqx, emqx_rule_engine, emqx_bridge, emqx_bridge_http]),
Apps = emqx_cth_suite:start(
[
emqx,
@ -125,7 +122,7 @@ basic_apply_rule_test_helper(Config, TraceType, StopAfterRender) ->
Params = #{
% body => #{
<<"context">> => Context,
<<"stop_action_after_template_render">> => StopAfterRender
<<"stop_action_after_template_rendering">> => StopAfterRender
% }
},
emqx_trace:check(),

View File

@ -66,6 +66,18 @@ test_context.desc:
test_context.label:
"""Event Conetxt"""
test_rule_environment.desc:
"""The environment that will be passed to the rule when it is applied. A default environment will be used if no environment is given."""
test_rule_environment.label:
"""Event Environment"""
stop_action_after_template_render.desc:
"""Set this to true if the action should be stopped after its template has been rendered."""
stop_action_after_template_render.label:
"""Stop Action After Template Rendering"""
node_node.desc:
"""The node name"""

View File

@ -90,4 +90,10 @@ api9.desc:
api9.label:
"""Get configuration"""
api11.desc:
"""Apply a rule with the given message and environment"""
api11.label:
"""Apply Rule"""
}