diff --git a/src/Controller/NonPaginatedEntityListingControllerTrait.php b/src/Controller/NonPaginatedEntityListingControllerTrait.php index 807302b5..1a14f446 100644 --- a/src/Controller/NonPaginatedEntityListingControllerTrait.php +++ b/src/Controller/NonPaginatedEntityListingControllerTrait.php @@ -23,7 +23,7 @@ /** * Trait NonPaginatedEntityListingControllerTrait. * - * @see \Apigee\Edge\Controller\NonPaginatedEntityListingControllerInterface + * @see NonPaginatedEntityListingControllerInterface */ trait NonPaginatedEntityListingControllerTrait { @@ -43,6 +43,9 @@ public function getEntities(): array $uri = $this->getBaseEndpointUri()->withQuery(http_build_query($query_params)); $response = $this->getClient()->get($uri); $responseArray = $this->responseToArray($response); + if ([] === $responseArray) { + return []; + } // Ignore entity type key from response, ex.: apiProduct. $responseArray = reset($responseArray);