-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposed ports is array when should be object #6
Comments
Opened an issue here janephp/janephp#700 |
hey @Rid thank you very much for your help all around! let's take the dust off of this project and make it work properly! |
@flavioheleno I have a version working locally, only #3 and this issue need to be patched manually in the generated code (although I haven't tested every API endpoint). Do you want me to make a PR with the needed client changes? |
I'd like to have those changes as |
@flavioheleno I've made a PR, I've also added automation via composer for applying the patches |
Looking at the API reference we're going to need a few more patches, basically anywhere we return an object we need to initialise it with $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); As if the object is empty, it will return an empty array, this is the same for parent objects and nested. I'll go through the API in a few days and add the patch where needed and update the patch set. |
Is it possible for you to add me to the repository so I can commit directly? |
that's weird, I thought Jane was already generating the proper code for that. I'll add you as a contributor |
Currently investigating this:
docker-php-api/src/Normalizer/ContainersCreatePostBodyNormalizer.php
Lines 245 to 251 in 0082dac
As it causes a
Error ContainerCreateInternalServerErrorException: json: cannot unmarshal array into Go struct field ContainerConfigWrapper.ExposedPorts of type struct {}
error because the generated json is:"ExposedPorts":{"10012/tcp":[],"80/tcp":[]}
When it should be
"ExposedPorts":{"10012/tcp":[],"80/tcp":{}}
The swagger is
So I'm not sure why janephp isn't generating this as the same as the denormalizer?
docker-php-api/src/Normalizer/ContainersCreatePostBodyNormalizer.php
Lines 80 to 85 in 0082dac
I'll open an issue with janephp if needed, just checking if you've already spotted this?
The text was updated successfully, but these errors were encountered: