This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new fd36e1d1f fix: plugin filter expr schema error (#7555)
fd36e1d1f is described below

commit fd36e1d1fb95d1c0a493c8eed22728b5ff15efd3
Author: soulbird <[email protected]>
AuthorDate: Fri Jul 29 13:58:22 2022 +0800

    fix: plugin filter expr schema error (#7555)
    
    Co-authored-by: soulbird <[email protected]>
---
 apisix/schema_def.lua | 4 ----
 t/admin/plugins.t     | 4 ++--
 t/plugin/plugin.t     | 2 +-
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/apisix/schema_def.lua b/apisix/schema_def.lua
index 232be9d86..3d721a4a4 100644
--- a/apisix/schema_def.lua
+++ b/apisix/schema_def.lua
@@ -960,10 +960,6 @@ _M.plugin_injected_schema = {
                 description = "filter determines whether the plugin "..
                                 "needs to be executed at runtime",
                 type  = "array",
-                maxItems = 20,
-                items = {
-                    type = "array"
-                }
             }
         }
     }
diff --git a/t/admin/plugins.t b/t/admin/plugins.t
index e7a04bd97..1d78b2432 100644
--- a/t/admin/plugins.t
+++ b/t/admin/plugins.t
@@ -265,7 +265,7 @@ plugins:
         }
     }
 --- response_body eval
-qr/\{"metadata_schema":\{"properties":\{"ikey":\{"minimum":0,"type":"number"\},"skey":\{"type":"string"\}\},"required":\["ikey","skey"\],"type":"object"\},"priority":0,"schema":\{"\$comment":"this
 is a mark for our injected plugin 
schema","properties":\{"_meta":\{"properties":\{"error_response":\{"oneOf":\[\{"type":"string"\},\{"type":"object"\}\]\},"filter":\{"description":"filter
 determines whether the plugin needs to be executed at 
runtime","items":\{"type":"array"\},"maxItems":20,"ty [...]
+qr/\{"metadata_schema":\{"properties":\{"ikey":\{"minimum":0,"type":"number"\},"skey":\{"type":"string"\}\},"required":\["ikey","skey"\],"type":"object"\},"priority":0,"schema":\{"\$comment":"this
 is a mark for our injected plugin 
schema","properties":\{"_meta":\{"properties":\{"error_response":\{"oneOf":\[\{"type":"string"\},\{"type":"object"\}\]\},"filter":\{"description":"filter
 determines whether the plugin needs to be executed at 
runtime","type":"array"\},"priority":\{"description": [...]
 
 
 
@@ -366,7 +366,7 @@ 
qr/\{"properties":\{"password":\{"type":"string"\},"username":\{"type":"string"\
         }
     }
 --- response_body
-{"priority":1003,"schema":{"$comment":"this is a mark for our injected plugin 
schema","properties":{"_meta":{"properties":{"error_response":{"oneOf":[{"type":"string"},{"type":"object"}]},"filter":{"description":"filter
 determines whether the plugin needs to be executed at 
runtime","items":{"type":"array"},"maxItems":20,"type":"array"},"priority":{"description":"priority
 of plugins by customized 
order","type":"integer"}},"type":"object"},"burst":{"minimum":0,"type":"integer"},"conn":{"ex
 [...]
+{"priority":1003,"schema":{"$comment":"this is a mark for our injected plugin 
schema","properties":{"_meta":{"properties":{"error_response":{"oneOf":[{"type":"string"},{"type":"object"}]},"filter":{"description":"filter
 determines whether the plugin needs to be executed at 
runtime","type":"array"},"priority":{"description":"priority of plugins by 
customized 
order","type":"integer"}},"type":"object"},"burst":{"minimum":0,"type":"integer"},"conn":{"exclusiveMinimum":0,"type":"integer"},"de
 [...]
 
 
 
diff --git a/t/plugin/plugin.t b/t/plugin/plugin.t
index 755294868..5baaed801 100644
--- a/t/plugin/plugin.t
+++ b/t/plugin/plugin.t
@@ -372,7 +372,7 @@ passed
         }
     }
 --- response_body
-{"error_msg":"failed to check the configuration of plugin jwt-auth err: 
property \"_meta\" validation failed: property \"filter\" validation failed: 
failed to validate item 1: wrong type: expected array, got string"}
+{"error_msg":"failed to validate the 'vars' expression: rule should be wrapped 
inside brackets"}
 {"error_msg":"failed to validate the 'vars' expression: invalid operator '*='"}
 
 

Reply via email to