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 插件支持根据给定的一组规则有条件地执行
   <link rel="canonical" href="https://docs.api7.ai/hub/workflow"; />
 </head>
 
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';

Review Comment:
   `import Tabs` / `import TabItem` are placed after a `<head>...</head>` 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 `<head>` 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
   <link rel="canonical" href="https://docs.api7.ai/hub/workflow"; />
 </head>
 
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';

Review Comment:
   The MDX `import` statements come after a `<head>...</head>` 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 `<head>` block (or replace the raw `<head>` 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
   <link rel="canonical" href="https://docs.api7.ai/hub/workflow"; />
 </head>
 
+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 插件支持根据给定的一组规则有条件地执行
   <link rel="canonical" href="https://docs.api7.ai/hub/workflow"; />
 </head>
 
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
 ## 描述
 
 `workflow` 插件支持根据给定的规则集有条件地执行对客户端流量的用户定义操作,这些规则集使用 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list) 
定义。这为流量管理提供了一种细粒度的方法。
 
 ## 属性
 
-| 名称          | 类型   | 必选项  | 默认值                    | 有效值                     
                                                                                
                                       | 描述 |
-| ------------- | ------ | ------ | ------------------------ | 
--------------------------------------------------------------------------------------------------------------------------------------------------
 | ------------- |
+| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 |
+|------|------|--------|--------|--------|------|
 | rules | array[object] | 是 | | | 一对或多对匹配条件和要执行的操作组成的数组。 |
 | rules.case | array[array] | 否 | | | 一个或多个匹配条件的数组,形式为 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list),例如 
`{"arg_name", "==", "json"}`。 |

Review Comment:
   `rules.case` 在 APISIX 的 schema 中允许同时包含数组项和字符串项(例如 lua-resty-expr 
中用于连接条件的字符串操作符)。当前文档把类型写成了 `array[array]`,范围偏窄。建议将类型更新为更准确的形式(例如 
`array[array|string]`),并在描述中补充说明 `case` 数组中也可以包含连接/操作符字符串。
   ```suggestion
   | rules.case | array[array|string] | 否 | | | 一个或多个匹配条件的数组,形式为 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list),例如 
`{"arg_name", "==", "json"}`。`case` 数组中的元素除了条件数组外,也可以包含用于连接条件的字符串操作符/连接符。 |
   ```



-- 
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]

Reply via email to