Skip to content

[BUG] TypeScript: wrong types for headers #663

@jabuj-amalytix

Description

@jabuj-amalytix

Environment
JS

Describe the bug
When using the getItemOffersBatch API the headers field is not optional as I assume it should be

requests: [
    {
      marketplaceId: 'A1PA6795UKMFR9',
      method: 'GET',
      uri: '/products/pricing/v0/items/B07QMT57K2/offers',
      itemCondition: 'New',
    },
  ],
// Type "{ marketplaceId: string; method: "GET"; uri: string; itemCondition: "New"; }" is missing the following properties from type "ItemOffersRequest": "headers, customerType".ts(2739)

Even if I specify the headers, they are typed incorrectly as { String: string } instead of { [key: string]: string }

  requests: [
    {
      marketplaceId: 'A1PA6795UKMFR9',
      method: 'GET',
      uri: '/products/pricing/v0/items/B07QMT57K2/offers',
      itemCondition: 'New',
      headers: {}
    },
  ],

// The property `String` is missing from the type `{}`, but required in type `{String: string}`. ts(2741)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions