amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
619 stars 741 forks source link

Freakish whitespace in SP-API JSON responses #535

Open johnkw opened 8 months ago

johnkw commented 8 months ago

This has bothered me for years but I held back on filing a bug report. This affects most (or all?) API responses. But just for example here's the response from testing bug amzn/selling-partner-api-models#370:

b'\n{\n\n\t\n\t\t\t\t\t\t"payload": {\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t"ShipmentData":\n\t\t\t\t[\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t}\n\n'

It's hilarious how it alternates back and forth between linefeeds and tabs, without ever outputting actual data.

This may not violate any JSON protocol, but it makes debug logs difficult to read for no reason.

github-actions[bot] commented 5 months ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 5 months ago

Can confirm this is still broken.

github-actions[bot] commented 4 months ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 4 months ago

This should not be closed. It could be converted to a "discussion" since that's apparently where bug reports go now.

github-actions[bot] commented 3 months ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 3 months ago

Still broken.

github-actions[bot] commented 2 months ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 2 months ago

Still broken.

github-actions[bot] commented 1 month ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 1 month ago

Still broken.

weilinggu commented 1 month ago

Can you provide a submission ID and endpoint you are calling of where you are getting these whitespaces in your response?

Weiling Gu Selling Partner API Developer Services

johnkw commented 1 month ago

I'm pretty sure every SP-API call has this problem. /fba/inbound/v0/shipments and /batches/products/pricing/v0/itemOffers certainly do. x-amzn-RequestId: c88ad3a6-1b52-405a-9a15-4abda06eb171.

weilinggu commented 1 month ago

Hi @johnkw,

Thank you for bringing this issue to our attention. We submitted the feature request to remove whitespaces for review. Once we receive additional information we will post an update.

Thanks Weiling, Selling Partner API Developer Services

weilinggu commented 1 month ago

@johnkw Can you provide request ID for each endpoint you are getting white space issue?

Weiling Selling Partner API Developer Services

johnkw commented 1 month ago

/batches/products/pricing/v0/itemOffers x-amzn-RequestId: 71ad84ad-be1a-4a1f-aa42-910ef1e7de2e /fba/inbound/v0/shipments x-amzn-RequestId: 506f2655-d9c1-466d-b1e6-cc62cb040e80

weilinggu commented 1 month ago

@johnkw Can you provide timestamp and region as well?

johnkw commented 1 month ago

How do I determine what the "region" is?

johnkw commented 1 month ago

Date: Thu, 10 Oct 2024 18:51:37 GMT x-amzn-RequestId: 506f2655-d9c1-466d-b1e6-cc62cb040e80

Date: Thu, 10 Oct 2024 18:51:02 GMT x-amzn-RequestId: 71ad84ad-be1a-4a1f-aa42-910ef1e7de2e

weilinggu commented 1 month ago

@johnkw Thanks for sharing. What is your marketplace?

johnkw commented 1 month ago

'MarketplaceId': 'ATVPDKIKX0DER'

github-actions[bot] commented 2 weeks ago

This issue is scheduled to close soon. If you are still encountering problems, please feel free to open a new issue and make a reference to this one.

johnkw commented 2 weeks ago

This has not been fixed.

By the way, I never mentioned it, but ideally there should be no whitespace at all for efficiency's sake.