nic-6443 commented on code in PR #12029: URL: https://github.com/apache/apisix/pull/12029#discussion_r2015205939
########## apisix/plugins/chaitin-waf.lua: ########## @@ -48,8 +52,11 @@ local match_schema = { local plugin_schema = { type = "object", properties = { - -- TODO: we should add a configuration "mode" here - -- It can be one of off, block and monitor + mode = { + type = "string", + enum = { "off", "monitor", "block", nil }, + default = nil, Review Comment: We don't need to explicitly specify nil in enum and default value. When this field is not declared as required in the JSON schema, it can be nil, and the default value is also nil. ########## apisix/plugins/chaitin-waf.lua: ########## @@ -88,6 +98,11 @@ local plugin_schema = { local metadata_schema = { type = "object", properties = { + mode = { + type = "string", + enum = { "off", "monitor", "block", nil }, + default = nil, Review Comment: ditto -- 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: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org