Formats of requests

You can specify JSON requests in either of two formats:
  • Detailed with __metadata annotations—The default format allows detailed, unambiguous requests. This format is especially useful when associations are involved, or when the entities have attributes that are used in many entities.
  • Native with no annotations—Many applications produce requests in the minimal format, presenting compact and readable files for requests. The format requires that Corticon parse the incoming data to identify the root entities and the attributes of the associated entities.
Either format is accepted as tester input. The following example uses the Advanced Tutorial's Ruleflow, as shown:


Sample request with full __metadata annotations
{
    "__metadataRoot": {"#locale": ""},
    "Objects": [{
        "preferredCard": {
            "cumulativeCashBack": 9.24,
            "__metadata": {
                "#type": "PreferredAccount",
                "#id": "PreferredAccount_id_1"
            },
            "cardNumber": "12"
        },
        "ShoppingCart": {
            "totalAmount": null,
            "Item": [
                {
                    "price": 55,
                    "name": "Filet Mignon",
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_1"
                    },
                    "department": null,
                    "barCode": "39-280-12345"
                },
                {
                    "price": 14.99,
                    "name": "Beach Towel",
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_2"
                    },
                    "department": null,
                    "barCode": "32-300-23456"
                },
                {
                    "price": 12.5,
                    "name": "Ginger Ale Case",
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_3"
                    },
                    "department": null,
                    "barCode": "32-285-34567"
                }
            ],
            "useCashBack": true,
            "savings": null,
            "__metadata": {
                "#type": "ShoppingCart",
                "#id": "ShoppingCart_id_1"
            }
        },
        "__metadata": {
            "#type": "Customer",
            "#id": "Customer_id_1"
        },
        "Name": ""
    }]
}