Re: [PR] docs: port workflow plugin documentation [apisix]

2026-04-16 Thread via GitHub


Yilialinn merged PR #13221:
URL: https://github.com/apache/apisix/pull/13221


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] docs: port workflow plugin documentation [apisix]

2026-04-14 Thread via GitHub


Copilot commented on code in PR #13221:
URL: https://github.com/apache/apisix/pull/13221#discussion_r3078220927


##
docs/zh/latest/plugins/workflow.md:
##
@@ -32,17 +32,20 @@ description: workflow 插件支持根据给定的一组规则有条件地执行
   https://docs.api7.ai/hub/workflow"; />
 
 
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';

Review Comment:
   `import Tabs` / `import TabItem` are placed after a `...` JSX 
block. MDX requires `import`/`export` declarations to be at the top of the 
document (before any JSX/Markdown content), otherwise compilation can fail. 
Please move these imports above the `` block (or switch to a Head 
component inserted after the imports).



##
docs/en/latest/plugins/workflow.md:
##
@@ -32,21 +32,24 @@ description: The workflow Plugin supports the conditional 
execution of user-defi
   https://docs.api7.ai/hub/workflow"; />
 
 
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';

Review Comment:
   The MDX `import` statements come after a `...` JSX block. In 
MDX, `import`/`export` declarations must appear before any other content/JSX, 
otherwise the page may fail to compile. Move the `import Tabs` / `import 
TabItem` lines above the `` block (or replace the raw `` usage with 
a component placed after the imports).



##
docs/en/latest/plugins/workflow.md:
##
@@ -32,21 +32,24 @@ description: The workflow Plugin supports the conditional 
execution of user-defi
   https://docs.api7.ai/hub/workflow"; />
 
 
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
 ## Description
 
-The `workflow` Plugin supports the conditional execution of user-defined 
actions to client traffic based a given set of rules, defined using 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). This 
provides a granular approach to traffic management.
+The `workflow` Plugin supports the conditional execution of user-defined 
actions to client traffic based on a given set of rules, defined using 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). This 
provides a granular approach to traffic management.
 
 ## Attributes
 
-| Name | Type  | Required | Default | Valid 
values | Description  |
-|  | - |  | --- | 
 |  |
-| rules   | array[object]  | True | |  
|  An array of one or more pairs of matching conditions and actions to be 
executed. |
-| rules.case   | array[array]  | False | | 
 | An array of one or more matching conditions in the form of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). For 
example, `{"arg_name", "==", "json"}`.  |
-| rules.actions| array[object] | True | |  
| An array of actions to be executed when a condition is successfully 
matched. Currently, the array only supports one action, and it should be either 
`return`, or `limit-count` or `limit-conn`. When the action is configured to be 
`return`, you can configure an HTTP status code to return to the client when 
the condition is matched. When the action is configured to be `limit-count`, 
you can configure all options of the [`limit-count`](./limit-count.md) plugin, 
except for `group`. When the action is configured to be `limit-conn`, you can 
configure all options of the [`limit-conn`](./limit-conn.md) plugin. |
+| Name | Type | Required | Default | Valid values | Description |
+|--|--|--|-|--|-|
+| rules | array[object] | True | | | An array of one or more pairs of matching 
conditions and actions to be executed. |
+| rules.case | array[array] | False | | | An array of one or more matching 
conditions in the form of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). For 
example, `{"arg_name", "==", "json"}`. |

Review Comment:
   The `rules.case` schema supports both array items and string items (e.g., 
string operators like `AND`/`OR` in lua-resty-expr). The docs currently list 
the type as `array[array]`, which is narrower than what APISIX accepts. Update 
the type (for example to `array[array|string]`) and/or clarify in the 
description that connector/operator strings are also allowed inside the `case` 
array.
   ```suggestion
   | rules.case | array[array|string] | False | | | An array of one or more 
matching conditions in the form of 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). Items 
can be condition arrays such as `{"arg_name", "==", "json"}` and 
connector/operator strings such as `AND` or `OR`. |
   ```



##
docs/zh/latest/plugins/workflow.md:
##
@@ -32,17 +32,20 @@ description: workflow 插件支持根据给定的一组规则有条件地执行
   https://docs.api7.ai