You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I need to get the full raw results of an API response.
In v1 it was possible via function $response->toArray():
But in v2 this method is marked as protected in lib/commercetools-base/src/Base/JsonObjectModel.php:
finalprotectedfunction toArray(): array
So we can't get the raw results by this method.
Describe the solution you'd like
Is there any other way to get the raw response as an array, like in v1?
If not, could you please consider making this method public in v2, like in v1?
Describe alternatives you've considered
Alternatively, maybe it's good to provide another method to get raw results if you don't want to make the current toArray public for some reason?
The text was updated successfully, but these errors were encountered:
This would still deserialize the response using json_deserialize. The jsonSerialize method would then convert the result to a serializable representation.
You could save the step by just using $request->send() as it would return the response with the raw string in the body.
Is your feature request related to a problem? Please describe.
I need to get the full raw results of an API response.
In v1 it was possible via function
$response->toArray()
:But in v2 this method is marked as protected in
lib/commercetools-base/src/Base/JsonObjectModel.php
:So we can't get the raw results by this method.
Describe the solution you'd like
Is there any other way to get the raw response as an array, like in v1?
If not, could you please consider making this method public in v2, like in v1?
Describe alternatives you've considered
Alternatively, maybe it's good to provide another method to get raw results if you don't want to make the current
toArray
public for some reason?The text was updated successfully, but these errors were encountered: