Skip to content
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

Incorrect API response #66

Open
Nacoma opened this issue Jan 16, 2020 · 0 comments
Open

Incorrect API response #66

Nacoma opened this issue Jan 16, 2020 · 0 comments

Comments

@Nacoma
Copy link
Contributor

Nacoma commented Jan 16, 2020

This can be easily replicated in by running the following test and examining the output in the CurlClient:

$pagesize = 1;
$list = Shippo_Parcel::all(array(
'results' => $pagesize,
'page' => '1'
));

The expected output format according to the documentation is:

{
  "next": null,
  "previous": null,
  "results": [
    {
      "object_state": ...
    },
  ]
}

When the page size is 1 the json fragment is:

{
  "next": null,
  "previous": null,
  "results": {
    "object_state": ...
  }

This causes the test to fail in PHP7.4 because the resulting object is not Countable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant