Catalog API doesn't respond properly to space at the end of strings
ID: 977033
No Fix
Published on 2/5/2024
•
Last update on 7/1/2024
Summary
When using the catalog API collection, if a string JSON field is sent ending with spaces (for instance productName: "myProductName ") the catalog APIs will respond with an improper 400 response and empty response body, leaving the user clueless about what was sent improperly.
The correct response should still be a 400 (bad request) but with an error handling informing which field is incorrect and why.
Simulation
For any catalog API (https://developers.vtex.com/docs/api-reference/catalog-api) insert 1+ empty spaces at the end of a string field, such as exemplified above.
Workaround
n/a
This type of string should not be accepted, but the error handling must be adjusted.