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 authored and dndx committed Oct 31, 2022
1 parent 65b981e commit 4750789
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 @@ -304,12 +304,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 @@ -319,7 +324,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 4750789

Please sign in to comment.