amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
534 stars 722 forks source link

Error in api-model-descriptions #3974

Open linde9821 opened 3 weeks ago

linde9821 commented 3 weeks ago

We have discovered the following error when using the openapi-descriptions to generate typesafe clients and datamodels.

Catalog_Items_API_v2022-04-01:

        "pagination": {
          "description": "If available, the `nextToken` and/or `previousToken` values required to return paginated results.",
          "$ref": "#/definitions/Pagination"
        }

       // ....

              "required": [
        "numberOfResults",
        "pagination",
        "refinements",
        "items"
      ],

As by the pagination description it seems like pagination can be null however it is listed as required. When testing the api we found that indeed it can be null so the description should look like this

      "required": [
        "numberOfResults",
        "items"
      ],

ordersV0

    "OrderItem": {
      "type": "object",
      "required": [
        "ASIN",
        "OrderItemId",
        "QuantityOrdered"
      ],

However the required field leads to some errors. After some testing we figured that actually everything can be absent from the response so the whole required should be removed.