spacewander commented on code in PR #8604:
URL: https://github.com/apache/apisix/pull/8604#discussion_r1089875682
##########
apisix/plugins/elasticsearch-logger.lua:
##########
@@ -23,18 +23,35 @@ local plugin = require("apisix.plugin")
local ngx = ngx
local str_format = core.string.format
+local math_random = math.random
+local type = type
local plugin_name = "elasticsearch-logger"
local batch_processor_manager = bp_manager_mod.new(plugin_name)
-local schema = {
- type = "object",
- properties = {
- endpoint_addr = {
+local endpoint_schema = {
+ anyOf = {
+ {
+ -- deprecated, use "array" instead
type = "string",
pattern = "[^/]$",
},
+ {
+ type = "array",
+ minItems = 1,
+ items = {
+ type = "string",
+ pattern = "[^/]$",
+ },
+ }
+ }
+}
+
+local schema = {
+ type = "object",
+ properties = {
+ endpoint_addr = endpoint_schema,
Review Comment:
> this change is not backward compatible
I am confused. People can still use the old endpoint_addr configuration.
> Keep endpoint_addr, add a new field endpoint_addrs to support both string
and array better
It is not a good idea to have a field of multiple types. The upstream's
nodes field is an example. People keep complaining that this field doesn't have
a consistent type.
--
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]