Skip to content

Allow getting raw results of an API ResponseΒ #182

@MurzNN

Description

@MurzNN

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():

$response = $request->execute();
$responseData = $response->toArray();

But in v2 this method is marked as protected in lib/commercetools-base/src/Base/JsonObjectModel.php:

    final protected function 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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions