From 2fe1ea275c2aac99f20085ee80801aa111c2c120 Mon Sep 17 00:00:00 2001 From: Abhishek Choudhary Date: Fri, 30 Aug 2024 10:54:47 +0545 Subject: [PATCH] lint fix --- apisix/plugins/content-moderation.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/apisix/plugins/content-moderation.lua b/apisix/plugins/content-moderation.lua index 48329046d91a..1583893e0e52 100644 --- a/apisix/plugins/content-moderation.lua +++ b/apisix/plugins/content-moderation.lua @@ -14,10 +14,13 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -local core = require("apisix.core") -local aws = require("resty.aws") -local aws_instance = aws() -local http = require("resty.http") +local core = require("apisix.core") +local aws = require("resty.aws") +local aws_instance = aws() +local http = require("resty.http") +local next = next +local pairs = pairs +local unpack = unpack local aws_comprehend_schema = { type = "object", @@ -33,7 +36,7 @@ local aws_comprehend_schema = { required = { "access_key_id", "secret_access_key", "region", } } -local schema = { +local schema = { type = "object", properties = { provider = { @@ -49,11 +52,11 @@ local schema = { patternProperties = { -- luacheck: push max code line length 300 ["^(PROFANITY|HATE_SPEECH|INSULT|HARASSMENT_OR_ABUSE|SEXUAL|VIOLENCE_OR_THREAT)$"] = { - type = "number", + -- luacheck: pop + type = "number", minimum = 0, maximum = 1 } - -- luacheck: pop }, additionalProperties = false },