bzp2010 commented on code in PR #12291:
URL: https://github.com/apache/apisix/pull/12291#discussion_r2139158062


##########
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:
   Added



##########
docs/en/latest/admin-api.md:
##########
@@ -278,6 +278,42 @@ curl 
'http://127.0.0.1:9180/apisix/admin/routes?name=test&uri=foo&label=' \
 }
 ```
 
+### Support reference filtering query
+
+:::note
+
+This feature was introduced in APISIX 3.13.0.
+
+It now supports querying by `service_id` and `upstream_id` on routes and 
stream routes. Other resources or other fields are not supported.

Review Comment:
   Fixed



-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to