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 69bb8b394 chore: explain why new injected fields should be under 
`_meta` (#7290)
69bb8b394 is described below

commit 69bb8b394b8480dd14b518bba5c38970fe7bf24e
Author: 罗泽轩 <[email protected]>
AuthorDate: Tue Jun 21 19:38:22 2022 +0800

    chore: explain why new injected fields should be under `_meta` (#7290)
    
    Signed-off-by: spacewander <[email protected]>
---
 apisix/plugin.lua | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/apisix/plugin.lua b/apisix/plugin.lua
index 5aad12e89..2276a5c33 100644
--- a/apisix/plugin.lua
+++ b/apisix/plugin.lua
@@ -151,6 +151,9 @@ local function load_plugin(name, plugins_list, plugin_type)
 
         properties._meta = plugin_injected_schema._meta
         -- new injected fields should be added under `_meta`
+        -- 1. so we won't break user's code when adding any new injected fields
+        -- 2. the semantics is clear, especially in the doc and in the caller 
side
+        -- TODO: move the `disable` to `_meta` too
 
         plugin.schema['$comment'] = plugin_injected_schema['$comment']
     end

Reply via email to