SylviaBABY commented on code in PR #6891:
URL: https://github.com/apache/apisix/pull/6891#discussion_r854753309
##########
docs/zh/latest/plugins/mocking.md:
##########
@@ -23,22 +29,29 @@ title: mocking
## 描述
-Mock API 插件,绑定该插件后将随机返回指定格式的`mock`数据,不再转发到后端。
+`mocking` 插件用于 Mock API。当执行该插件时,它将随机返回指定格式的模拟数据,并且请求不会转发到上游。
## 属性
-| 名称 | 类型 | 必选项 | 默认值 | 有效值
| 描述
|
-| ------------- | -------| ----- | ----- |
-------------------------------------------------------------- |
-------------------------------------------------------------------------------------------------------------------------------------------------
|
-| delay | integer | 可选 | |
| 延时返回的时间,单位为秒
|
-| response_status | integer| 可选 | 200 |
| 返回的响应 http status code
|
-| content_type | string | 可选 | application/json |
| 返回的响应头的 Content-Type。
|
-| response_example| string | 可选 | |
| 返回的响应体,与`response_schema`字段二选一
|
-| response_schema | object | 可选 | |
|
指定响应的`jsonschema`对象,未指定`response_example`字段时生效,具体结构看后文说明
|
-| with_mock_header | boolean | 可选 | true |
| 是否返回响应头:"x-mock-by: APISIX/{version}",默认返回,指定为
false 则不返回 |
+| 名称 | 类型 | 必选项 | 默认值 | 描述
|
+| ------------- | -------| ----- | ---------------- |
--------------------------------------------------------------------------- |
+| delay | integer| 否 | | 延时返回的时间,单位为秒。
|
+| response_status | integer| 否 | 200 | 返回响应的 HTTP 状态码。
|
+| content_type | string | 否 | application/json | 返回响应的 Header
`Content-Type`。 |
+| response_example| string | 否 | | 返回响应的 Body,与
`response_schema` 字段二选一。 |
+| response_schema | object | 否 | | 指定响应的 `jsonschema`
对象,未指定 `response_example` 字段时生效。 |
+| with_mock_header| boolean| 否 | true | 当设置为 `true` 时,将添加响应头
`x-mock-by: APISIX/{version}`。设置为 `false` 时则不添加该响应头。 |
-支持的字段类型:`string`, `number`, `integer`, `boolean`, `object`, `array`
-基础数据类型(`string`,`number`,`integer`,`boolean`)可通过配置`example`属性指定生成的响应值,未配置时随机返回。
-以下是一个`jsonschema`实例:
+JSON schema 在其字段中支持以下类型:
Review Comment:
```suggestion
JSON Schema 在其字段中支持以下类型:
```
--
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]