Skip to content

Commit

Permalink
fix(get): propagate next page size param Kong#9029
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksjm committed Oct 7, 2022
1 parent 7963425 commit 503eb49
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kong/api/endpoints.lua
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,17 @@ end
local function get_collection_endpoint(schema, foreign_schema, foreign_field_name, method)
return not foreign_schema and function(self, db, helpers)
local next_page_tags = ""
local next_page_size = ""

local args = self.args.uri
if args.tags then
next_page_tags = "&tags=" .. escape_uri(type(args.tags) == "table" and args.tags[1] or args.tags)
end

if args.size then
next_page_size = "&size=" .. escape_uri(type(args.size) == "number" and args.size[1] or args.size)
end

local data, _, err_t, offset = page_collection(self, db, schema, method)
if err_t then
return handle_error(err_t)
Expand All @@ -318,7 +323,8 @@ local function get_collection_endpoint(schema, foreign_schema, foreign_field_nam
schema.admin_api_name or
schema.name,
escape_uri(offset),
next_page_tags) or null
next_page_tags,
next_page_size) or null

return ok {
data = data,
Expand Down

0 comments on commit 503eb49

Please sign in to comment.