0

Guys please the code block below, I have difficulty on defining the order details using JSON.

I think the detail of the order should be an array of ordered items. And some of the item can be a combination of 2 or more components that can be described as an array too.

Please help to create a swagger compatible document of the creating order API base on the payload.

{
    "salesman": {
        "name": "teststoreadmin"       
    },

    "customer": {
        "name": "customerTest"
    },

    "salesOrderItems": 
    [
        [
            {
                "itemType": "typeName1",
                "componentName": "componentName1"
            },
            {
                "itemType": "typeName2",
                "componentName": "componentName2"
            }
        ],
        {
            "itemType": "typeName3",
            "componentName": "componentName3"
        }
    ],
    "total": 4503
}
Yang Han
  • 1
  • 1
  • 1
    This appears to be invalid json ... try using https://jsonlint.com/ to validate json – 95faf8e76605e973 Aug 03 '18 at 09:35
  • I have removed the trailing comma, it seems fine now – Yang Han Aug 03 '18 at 09:44
  • Possible duplicate of [Tell Swagger that the request body can be a single object or a list of objects](https://stackoverflow.com/questions/31742151/tell-swagger-that-the-request-body-can-be-a-single-object-or-a-list-of-objects), [How to create different element types within Swagger 2.0 editor](https://stackoverflow.com/q/38690802/113116), [How do you create a swagger schema that includes an array of varying types](https://stackoverflow.com/q/36318849/113116) – Helen Aug 03 '18 at 09:55

0 Answers0