You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by me...@apache.org on 2020/07/30 01:41:44 UTC
[incubator-apisix] branch master updated: doc: improvements for OSx
unit tests (#1926)
This is an automated email from the ASF dual-hosted git repository.
membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git
The following commit(s) were added to refs/heads/master by this push:
new a7a4fbe doc: improvements for OSx unit tests (#1926)
a7a4fbe is described below
commit a7a4fbe8f400f977551a38040c11203d1aafb0c9
Author: Nirojan Selvanathan <ss...@gmail.com>
AuthorDate: Thu Jul 30 03:41:36 2020 +0200
doc: improvements for OSx unit tests (#1926)
doc(request-validation): fixed the wrong example.
---
doc/how-to-build.md | 14 +++++++--
doc/plugins/request-validation.md | 60 +++++++++++++++++++++------------------
2 files changed, 43 insertions(+), 31 deletions(-)
diff --git a/doc/how-to-build.md b/doc/how-to-build.md
index 50c825c..2d7f1fa 100644
--- a/doc/how-to-build.md
+++ b/doc/how-to-build.md
@@ -115,12 +115,20 @@ Makefile rules:
* Run the test cases: `make test`
* To set the path of nginx to run the test cases: `TEST_NGINX_BINARY=/usr/local/bin/openresty prove -Itest-nginx/lib -r t`
-### Troubleshoot
+### Troubleshoot Testing
-If you run in to an issue `Error unknown directive "lua_package_path" in /API_ASPIX/incubator-apisix/t/servroot/conf/nginx.conf`
+**Set Nginx Path**
+- If you run in to an issue `Error unknown directive "lua_package_path" in /API_ASPIX/incubator-apisix/t/servroot/conf/nginx.conf`
make sure to set openresty as default nginx. And export the path as below.
-
* export PATH=/usr/local/openresty/nginx/sbin:$PATH
+ - Linux default installation path:
+ * export PATH=/usr/local/openresty/nginx/sbin:$PATH
+ - OSx default installation path via homebrew:
+ * export PATH=/usr/local/opt/openresty/nginx/sbin:$PATH
+
+**Run Individual Test Cases**
+- Use the following command to run test cases constratined to a file:
+ - prove -Itest-nginx/lib -r t/plugin/openid-connect.t
## 5. Update Admin API token to protect Apache APISIX
diff --git a/doc/plugins/request-validation.md b/doc/plugins/request-validation.md
index fd23227..7c29e87 100644
--- a/doc/plugins/request-validation.md
+++ b/doc/plugins/request-validation.md
@@ -107,15 +107,17 @@ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H 'X-API-KEY: edd1c9f034335f13
**Using ENUMS:**
-```shell
-"body_schema": {
- "type": "object",
- "required": ["required_payload"],
- "properties": {
- "emum_payload": {
- "type": "string",
- enum: ["enum_string_1", "enum_string_2"]
- default = "enum_string_1"
+```json
+{
+ "body_schema": {
+ "type": "object",
+ "required": ["required_payload"],
+ "properties": {
+ "emum_payload": {
+ "type": "string",
+ "enum": ["enum_string_1", "enum_string_2"],
+ "default": "enum_string_1"
+ }
}
}
}
@@ -124,25 +126,27 @@ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H 'X-API-KEY: edd1c9f034335f13
**JSON with multiple levels:**
-```shell
-"body_schema": {
- "type": "object",
- "required": ["required_payload"],
- "properties": {
- "boolean_payload": {"type": "boolean"},
- "child_element_name": {
- "type": "object",
- "properties": {
- "http_statuses": {
- "type": "array",
- "minItems": 1,
- "items": {
- "type": "integer",
- "minimum": 200,
- "maximum": 599
- },
- "uniqueItems": true,
- "default": [200, 201, 202, 203]
+```json
+{
+ "body_schema": {
+ "type": "object",
+ "required": ["required_payload"],
+ "properties": {
+ "boolean_payload": {"type": "boolean"},
+ "child_element_name": {
+ "type": "object",
+ "properties": {
+ "http_statuses": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "integer",
+ "minimum": 200,
+ "maximum": 599
+ },
+ "uniqueItems": true,
+ "default": [200, 201, 202, 203]
+ }
}
}
}