The InventoryItem type does not match.
- [x] Are you running the latest version?
- [x] Have you included sample input, output, error, and expected output?
- [x] Have you checked if you are using correct configuration?
Describe the bug
In the createOrReplaceInventoryItem function, the type of the aspects in the body argument is set to string, but assigning a string causes it to fail. However, it succeeded when I passed an object directly.
Code
await client.sell.inventory.createOrReplaceInventoryItem("testSku", {
availability: {
shipToLocationAvailability: {
quantity: 1,
},
},
condition: "USED_EXCELLENT",
product: {
title: "test title",
description: "test description",
imageUrls: ["https:/xxx.com/example.jpg"],
aspects: JSON.stringify({ Type: ["Action Figure"] }),
// When I changed the aspects as below with @ts-ignore marker, it succeeded.
// @ts-ignore
// aspects: { Type: ["Action Figure"] }
},
});
Output
The following is part of the error output.
errorCode: 2004,
firstError: {
errorId: 2004,
domain: 'ACCESS',
category: 'REQUEST',
message: 'Invalid request',
longMessage: 'The request has errors. For help, see the documentation for this API.',
parameters: [
{
name: 'reason',
value: 'Could not serialize field [product.aspects]'
}
]
}
Would you like to work on this issue?
- [ ] Yes
- [ ] No
- [x] Maybe
The TS Definition is based on eBay Open-API. Either this is a new version or the eBay Open-API is not correct. Thank you for reporting, I will check it. For now, I would ignore the error.
Ah, I understand now. Thank you.
@naotoman The latest sell inventory api version 1.18.0 also does not fix this problem. I'll close this issue for now otherwise I have to monkey patch the generated type...