I'm struggling with guzzle service description to work with a list of objects.
The following code works as expected.
php
$product = new stdClass;
$product->price = 18;
echo json_encode([$product, $product]);
guzzle service description model section
'models' => [
'products' => [
'type' => 'object',
'additionalProperties' => [
'location' => 'json'
]
]
]
outputs
array:2 [▼
0 => array:1 [▼
"price" => "18.00"
]
1 => array:1 [▼
"price" => "18.00"
]
]
now..how do I write a model description when I have the following response from PHP?
$product = new stdClass;
$product->price = "18.00";
echo json_encode(['products'=>[$product, $product]]);