spacewander commented on code in PR #7707:
URL: https://github.com/apache/apisix/pull/7707#discussion_r948617151


##########
apisix/plugin.lua:
##########
@@ -761,8 +770,11 @@ local function check_single_plugin_schema(name, 
plugin_conf, schema_type, skip_d
     end
 
     if plugin_obj.check_schema then
-        local disable = plugin_conf.disable
-        plugin_conf.disable = nil
+        local disable = check_disable(plugin_conf)
+        if disable ~= nil then
+            plugin_conf._meta.disable = nil

Review Comment:
   Once we have moved the `disable` to _meta, we don't need to delete it during 
the check_schema. As there is no longer a top level extra field in the conf.



##########
docs/en/latest/terminology/plugin.md:
##########
@@ -80,10 +80,25 @@ Some common configurations can be applied to plugins 
through the `_meta` configu
 
 | Name         | Type | Description |
 |--------------|------|-------------|
+| disable      | boolean  | Whether to disable the plugin |
 | error_response | string/object  | Custom error response |
 | priority       | integer        | Custom plugin priority |
 | filter  | array | Depending on the requested parameters, it is decided at 
runtime whether the plugin should be executed. Something like this: `{{var, 
operator, val}, {var, operator, val}, ...}}`. For example: `{"arg_version", 
"==", "v2"}`, indicating that the current request parameter `version` is `v2`. 
The variables here are consistent with NGINX internal variables. For details on 
supported operators, please see 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list). |
 
+### Disable the plugin
+
+Through the `disable` configuration, you can add a new plugin with disabled 
status and the request will not go through the plugin. This feature is used in 
the APISIX Dashboard.

Review Comment:
   We don't need to mention the Dashboard as this feature can be used by any 
other components too.



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