Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

Nullable foreach value bug #4

Open
wants to merge 1 commit into
base: 4.1.36
Choose a base branch
from

Conversation

bkayranci
Copy link

ErrorException thrown with message "Invalid argument supplied for foreach()"

Stacktrace:

#65 ErrorException in /path/vendor/docker-php/docker-php-api/src/Normalizer/NetworkSettingsNormalizer.php:60
#64 Illuminate\Foundation\Bootstrap\HandleExceptions:handleError in /path/vendor/docker-php/docker-php-api/src/Normalizer/NetworkSettingsNormalizer.php:60
#63 Docker\API\Normalizer\NetworkSettingsNormalizer:denormalize in /path/vendor/symfony/serializer/Serializer.php:177
#62 Symfony\Component\Serializer\Serializer:denormalize in /path/vendor/docker-php/docker-php-api/src/Normalizer/ContainersIdJsonGetResponse200Normalizer.php:122
#61 Docker\API\Normalizer\ContainersIdJsonGetResponse200Normalizer:denormalize in /path/vendor/symfony/serializer/Serializer.php:177
#60 Symfony\Component\Serializer\Serializer:denormalize in /path/vendor/symfony/serializer/Serializer.php:128
#59 Symfony\Component\Serializer\Serializer:deserialize in /path/vendor/docker-php/docker-php-api/src/Endpoint/ContainerInspect.php:76
#58 Docker\API\Endpoint\ContainerInspect:transformResponseBody in /path/vendor/jane-php/open-api-runtime/Client/Psr7HttplugEndpointTrait.php:18
#57 Docker\API\Endpoint\ContainerInspect:parsePSR7Response in /path/vendor/jane-php/open-api-runtime/Client/Psr7HttplugClient.php:48
#56 Jane\OpenApiRuntime\Client\Psr7HttplugClient:executePsr7Endpoint in /path/vendor/docker-php/docker-php-api/src/Client.php:81
#55 Docker\API\Client:containerInspect in /path/app/Http/Controllers/DockerController.php:113

…/vendor/docker-php/docker-php-api/src/Normalizer/NetworkSettingsNormalizer.php:60

Fragment of docker inspect command:

       "8302/udp": null,
        "8500/tcp": [
            {
                "HostIp": "0.0.0.0",
                "HostPort": "32792"
            }
        ],

@Blizzke
Copy link

Blizzke commented Jan 4, 2019

This probably won't be merged as it happens in a generated file.
It's the swagger definition that needs to be updated to fix this.

That being said, I just ran against the same problem. An exposed but not mapped port is returned as '<port>/<protocol>' => null (API 1.39)

See also:
screenshot 2019-01-04 at 14 19 08

Can this situation possible be handled?

Edit: guess we're not the only ones:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants