Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad "getOrderItemsBuyerInfo" response example. #333

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

deven
Copy link

@deven deven commented Sep 20, 2023

The previous example for a successful 200 response code did not match the structure of the "GetOrderItemsBuyerInfoResponse" response schema (see below). It was missing the "OrderItemsBuyerInfoList" and "OrderItemBuyerInfoList" levels of the data structure, skipping straight to the "OrderItemBuyerInfo" level instead, where it had an incorrect value of "903-1671087-0812628" for "OrderItemId", which actually should have been the "AmazonOrderId" in the missing "OrderItemsBuyerInfoList" level of the structure.

To fix this example response, I started with the data from the example response for "getOrderItems", which was using the same "AmazonOrderId" value of "903-1671087-0812628". I restructured the response data to match the correct response schema for this operation and removed the extraneous data.

The fixed example should be valid for the response schema:

"GetOrderItemsBuyerInfoResponse": {
  "type": "object",
  "properties": {
    "payload": {
      "description": "The payload for the getOrderItemsBuyerInfo operation.",
      "$ref": "#/definitions/OrderItemsBuyerInfoList"
    },
    "errors": {
      "description": "One or more unexpected errors occurred during the getOrderItemsBuyerInfo operation.",
      "$ref": "#/definitions/ErrorList"
    }
  },
  "description": "The response schema for the getOrderItemsBuyerInfo operation."
},
"OrderItemsBuyerInfoList": {
  "type": "object",
  "required": [
    "AmazonOrderId",
    "OrderItems"
  ],
  "properties": {
    "OrderItems": {
      "$ref": "#/definitions/OrderItemBuyerInfoList"
    },
    "NextToken": {
      "type": "string",
      "description": "When present and not empty, pass this string token in the next request to return the next response page."
    },
    "AmazonOrderId": {
      "type": "string",
      "description": "An Amazon-defined order identifier, in 3-7-7 format."
    }
  },
  "description": "A single order item's buyer information list with the order ID."
},
"OrderItemBuyerInfoList": {
  "type": "array",
  "description": "A single order item's buyer information list.",
  "items": {
    "$ref": "#/definitions/OrderItemBuyerInfo"
  }
},
"OrderItemBuyerInfo": {
  "type": "object",
  "required": [
    "OrderItemId"
  ],
  "properties": {
    "OrderItemId": {
      "type": "string",
      "description": "An Amazon-defined order item identifier."
    },
    "BuyerCustomizedInfo": {
      "description": "Buyer information for custom orders from the Amazon Custom program.",
      "$ref": "#/definitions/BuyerCustomizedInfoDetail"
    },
    "GiftWrapPrice": {
      "description": "The gift wrap price of the item.",
      "$ref": "#/definitions/Money"
    },
    "GiftWrapTax": {
      "description": "The tax on the gift wrap price.",
      "$ref": "#/definitions/Money"
    },
    "GiftMessageText": {
      "type": "string",
      "description": "A gift message provided by the buyer."
    },
    "GiftWrapLevel": {
      "type": "string",
      "description": "The gift wrap level specified by the buyer."
    }
  },
  "description": "A single order item's buyer information."
},

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The previous example for a successful 200 response code did not match
the structure of the "GetOrderItemsBuyerInfoResponse" response schema
(see below).  It was missing the "OrderItemsBuyerInfoList" and
"OrderItemBuyerInfoList" levels of the data structure, skipping straight
to the "OrderItemBuyerInfo" level instead, where it had an incorrect
value of "903-1671087-0812628" for "OrderItemId", which actually should
have been the "AmazonOrderId" in the missing "OrderItemsBuyerInfoList"
level of the structure.

To fix this example response, I started with the data from the example
response for "getOrderItems", which was using the same "AmazonOrderId"
value of "903-1671087-0812628".  I restructured the response data to
match the correct response schema for this operation and removed the
extraneous data.

The fixed example should be valid for the response schema:

    "GetOrderItemsBuyerInfoResponse": {
      "type": "object",
      "properties": {
        "payload": {
          "description": "The payload for the getOrderItemsBuyerInfo operation.",
          "$ref": "#/definitions/OrderItemsBuyerInfoList"
        },
        "errors": {
          "description": "One or more unexpected errors occurred during the getOrderItemsBuyerInfo operation.",
          "$ref": "#/definitions/ErrorList"
        }
      },
      "description": "The response schema for the getOrderItemsBuyerInfo operation."
    },
    "OrderItemsBuyerInfoList": {
      "type": "object",
      "required": [
        "AmazonOrderId",
        "OrderItems"
      ],
      "properties": {
        "OrderItems": {
          "$ref": "#/definitions/OrderItemBuyerInfoList"
        },
        "NextToken": {
          "type": "string",
          "description": "When present and not empty, pass this string token in the next request to return the next response page."
        },
        "AmazonOrderId": {
          "type": "string",
          "description": "An Amazon-defined order identifier, in 3-7-7 format."
        }
      },
      "description": "A single order item's buyer information list with the order ID."
    },
    "OrderItemBuyerInfoList": {
      "type": "array",
      "description": "A single order item's buyer information list.",
      "items": {
        "$ref": "#/definitions/OrderItemBuyerInfo"
      }
    },
    "OrderItemBuyerInfo": {
      "type": "object",
      "required": [
        "OrderItemId"
      ],
      "properties": {
        "OrderItemId": {
          "type": "string",
          "description": "An Amazon-defined order item identifier."
        },
        "BuyerCustomizedInfo": {
          "description": "Buyer information for custom orders from the Amazon Custom program.",
          "$ref": "#/definitions/BuyerCustomizedInfoDetail"
        },
        "GiftWrapPrice": {
          "description": "The gift wrap price of the item.",
          "$ref": "#/definitions/Money"
        },
        "GiftWrapTax": {
          "description": "The tax on the gift wrap price.",
          "$ref": "#/definitions/Money"
        },
        "GiftMessageText": {
          "type": "string",
          "description": "A gift message provided by the buyer."
        },
        "GiftWrapLevel": {
          "type": "string",
          "description": "The gift wrap level specified by the buyer."
        }
      },
      "description": "A single order item's buyer information."
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant