membphis commented on code in PR #12291:
URL: https://github.com/apache/apisix/pull/12291#discussion_r2136790722
##########
apisix/admin/v3_adapter.lua:
##########
@@ -120,11 +122,43 @@ local function pagination(body, args)
end
-local function filter(body, args)
- if not args.name and not args.label and not args.uri then
- return
+local function _filter(item, args, resource)
+ if not args.filter then
+ return true
+ end
+
+ local filters, err = ngx.decode_args(args.filter or "", 100)
+ if not filters then
+ log.error("failed to decode filter args: ", err)
+ return false
+ end
+
+ for key, value in pairs(filters) do
+ if not resource.list_filter_fields[key] then
+ log.warn("filter field '", key, "' is not supported by resource:
", resource.name)
Review Comment:
need a test case to confirm it
--
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]