Skip to content

[BUG] TS type declarations incorrectly declare arrays #627

@davidszoke1

Description

@davidszoke1

Environment
JS SDK 1.7.0

Describe the bug
In the type declarations the arrays are wrong.
They are all like this: [string] instead of string[].
This makes the parameters only accept arrays that contain exactly 1 string.

To Reproduce

Try to make a valid request:

 const marketplaceIds = ['marketplaceId1', 'marketplaceId2', 'marketplaceId3'];
 const ordersResult: OrdersSpApi.GetOrdersResponse = await this.ordersSdk.getOrders(marketplaceIds, {});

Result:
marketplaceIds param underlined. Error:
TS2345: Argument of type string[] is not assignable to parameter of type [string]
Target requires 1 element(s) but source may have fewer.

Expected behavior
Sdk correctly handles arrays, parameters accept arrays with multiple items.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions