ScaleLeap / selling-partner-api-sdk

A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
https://npm.im/@scaleleap/selling-partner-api-sdk
MIT License
68 stars 28 forks source link

Wrong content type for cancelInboundPlan #1039

Closed Javadebi closed 7 months ago

Javadebi commented 7 months ago

Hello, thank you for your awesome package. I just wanted to report a bug in the cancelInboundPlan operation from your newest update, FulfillmentInboundApiClientV20240320. The content type is incorrect and should be set to "application/json; charset=utf-8".

Javadebi commented 7 months ago

This problem also exists on generatePackingOptions operation.

Javadebi commented 7 months ago

Also for confirmPackingOption operation.

Javadebi commented 7 months ago

1040 gh pr checkout 1040

nguyentoanit commented 7 months ago

@Javadebi : We're using models from API model's repo to generate classes automatically. Therefore, We shouldn't update directly generated api models.

Also, this package allows to override headers while calling methods as well:

client
      .createReport(
        {
          body: {
            reportType,
            dataStartTime: startDate,
            dataEndTime: endDate,
            marketplaceIds,
            reportOptions,
          },
        },
        {
          headers: {
            'content-type': 'application/json; charset=utf-8',
          },
        },
      )

And, you can raise an issue Or open a PR to fix the bugs in the specs in https://github.com/amzn/selling-partner-api-models. Once they are fixed, our API clients will be re-generated and released.

Javadebi commented 7 months ago

@Javadebi : We're using models from API model's repo to generate classes automatically. Therefore, We shouldn't update directly generated api models.

Also, this package allows to override headers while calling methods as well:

client
      .createReport(
        {
          body: {
            reportType,
            dataStartTime: startDate,
            dataEndTime: endDate,
            marketplaceIds,
            reportOptions,
          },
        },
        {
          headers: {
            'content-type': 'application/json; charset=utf-8',
          },
        },
      )

And, you can raise an issue Or open a PR to fix the bugs in the specs in https://github.com/amzn/selling-partner-api-models. Once they are fixed, our API clients will be re-generated and released.

Thank you, I knew that you can pass headers manually, but did not know it is automatically generated.