membphis commented on a change in pull request #2430: URL: https://github.com/apache/apisix/pull/2430#discussion_r515773828
########## File path: apisix/core/set.lua ########## @@ -0,0 +1,40 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +local nkeys = require("table.nkeys") +local pairs = pairs + + +local _M = {} + + +-- Compare two tables as if they are sets (only compare the key part) +function _M.eq(a, b) Review comment: how about move the `eq` into `apisix.core.table`? ########## File path: apisix/plugins/prometheus.lua ########## @@ -29,7 +29,6 @@ local _M = { version = 0.2, priority = 500, name = plugin_name, - init = exporter.init, Review comment: why do we need to delete this line? I think we need to keep it. ########## File path: apisix/core/set.lua ########## @@ -0,0 +1,40 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +local nkeys = require("table.nkeys") +local pairs = pairs + + +local _M = {} + + +-- Compare two tables as if they are sets (only compare the key part) +function _M.eq(a, b) Review comment: if yes, we need a better function name. ########## File path: apisix/plugins/prometheus.lua ########## @@ -29,7 +29,6 @@ local _M = { version = 0.2, priority = 500, name = plugin_name, - init = exporter.init, Review comment: why do we need to delete this line? I think we need to keep it. ########## File path: apisix/plugins/prometheus.lua ########## @@ -29,7 +29,6 @@ local _M = { version = 0.2, priority = 500, name = plugin_name, - init = exporter.init, Review comment: why do we need to delete this line? I think we need to keep it. ########## File path: apisix/schema_def.lua ########## @@ -665,6 +665,23 @@ _M.stream_route = { } +_M.plugins = { + type = "array", + items = { + type = "object", + properties = { + name = { + type = "string" + }, + stream = { + type = "boolean" + }, + }, + required = {"name"} Review comment: add `additionalProperties = false` ########## File path: apisix/schema_def.lua ########## @@ -665,6 +665,23 @@ _M.stream_route = { } +_M.plugins = { + type = "array", + items = { + type = "object", + properties = { + name = { + type = "string" Review comment: need to limit the `max`, `min` length. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
