xiaoxuanzi commented on code in PR #8604:
URL: https://github.com/apache/apisix/pull/8604#discussion_r1089671282
##########
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:
Hi @spacewander , thank you for your reply.
In my opinion, to use **endpoint_addrs** will cause trouble, this change is
not backward compatible.
The code submitted for the first time is modified as follows:
```
local schema = {
type = "object",
properties = {
+ -- deprecated, use "endpoint_addrs" instead
endpoint_addr = {
type = "string",
pattern = "[^/]$",
},
+ endpoint_addrs = {
+ type = "array",
+ minItems = 1,
+ items = {
+ type = "string",
+ pattern = "[^/]$",
+ },
+ },
```
I fixed the code according to @soulbird's suggestion.
https://github.com/apache/apisix/pull/8604#discussion_r1061187611
--
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]