diff --git a/kong/clustering/rpc/callbacks.lua b/kong/clustering/rpc/callbacks.lua index 2935cbab5a54..05a0a89c45d0 100644 --- a/kong/clustering/rpc/callbacks.lua +++ b/kong/clustering/rpc/callbacks.lua @@ -9,6 +9,7 @@ local _M = {} local _MT = { __index = _M, } +local cjson = require("cjson.safe") local utils = require("kong.clustering.rpc.utils") @@ -22,6 +23,9 @@ function _M.new() capabilities_list = {}, -- updated as register() is called } + -- it should always be an array when json encoding + setmetatable(self.capabilities_list, cjson.array_mt) + return setmetatable(self, _MT) end