I have a swagger file with nested objects. If I convert the object to a string, the nested objects are not serialized to json.
To illustrate the problem I created the following minimal working example of a Swagger definition file: https://gist.github.com/moee/c5fd1d0e10e4bbec654a
Reproduction
- Import the provided example into the Swagger editor: http://editor.swagger.io/#/?import=https:%2F%2Fgist.githubusercontent.com%2Fmoee%2Fc5fd1d0e10e4bbec654a%2Fraw%2F0585c6482e5d4cb3bc14c26361d74ee7f553b7f8%2Fpetstore.yaml
- Click
Generate Client > PHP
With the generated client consider the following code:
<?php
$petStore = new \Swagger\Client\Model\PetStore();
$dog = new \Swagger\Client\Model\Pet();
$dog->setName("dog");
$petStore->setPets([$dog]);
echo strval($petStore);
Expected result
{ "pets": [ { "name": "dog" } ] }
Actual result
Is this behavior intended or am I missing something?
I have a swagger file with nested objects. If I convert the object to a string, the nested objects are not serialized to json.
To illustrate the problem I created the following minimal working example of a Swagger definition file: https://gist.github.com/moee/c5fd1d0e10e4bbec654a
Reproduction
Generate Client>PHPWith the generated client consider the following code:
Expected result
Actual result
Is this behavior intended or am I missing something?