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

Empty extra array results in API failure #63

Open
chamby opened this issue Apr 29, 2019 · 2 comments
Open

Empty extra array results in API failure #63

chamby opened this issue Apr 29, 2019 · 2 comments

Comments

@chamby
Copy link

chamby commented Apr 29, 2019

Setting extra to [] results in a JSON encoded array instead of an object. The Shippo API rejects this format with the following message:

{"shipment": [{"extra": ["Invalid format of the 'extra' object. The accepted format is 'extra': {}"]}]}

Perhaps JSON_FORCE_OBJECT or dropping empty extra parameter could be used to resolve this from the PHP library side.

Something changed recently at the API end because until last week the array format was working, but now all of my calls with an empty array fail. I will manually ensure that no empty array is passed to the PHP client, but thought you should be aware.

This is on version 1.4.3

@malcolmrebughini
Copy link

malcolmrebughini commented Apr 29, 2019

Hi.

We recently did some changes to the API because we noticed that some calls included an empty array for extras and that would result in a 500 response. So we added the proper status code and error to the response.

We'll look into how the error response is parsed on the library side so it can be surfaced properly.

Thanks.

@Rotron
Copy link

Rotron commented Jan 14, 2020

any news?

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

3 participants