From f2a856203117bf97a8dfa5960468ae70e4526e3e Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 9 Feb 2021 22:45:18 +0100 Subject: Fix compat networks endpoint for a empty result The networks list compat api endpoint must return `[]` and not `null` if no networks are found. Fixes #9293 Signed-off-by: Paul Holzinger --- test/apiv2/35-networks.at | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at index 5327bd076..7ce109913 100644 --- a/test/apiv2/35-networks.at +++ b/test/apiv2/35-networks.at @@ -46,6 +46,9 @@ length=1 \ # invalid filter filters={"dangling":["1"]} t GET networks?filters=%7B%22dangling%22%3A%5B%221%22%5D%7D 500 \ .cause='invalid filter "dangling"' +# (#9293 with no networks the endpoint should return empty array instead of null) +t GET networks?filters=%7B%22name%22%3A%5B%22doesnotexists%22%5D%7D 200 \ +"[]" # network inspect docker t GET networks/a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1 200 \ -- cgit v1.2.3-54-g00ecf