Match the shape before filling in values
Explain how to build valid JSON test payloads that match an event contract, including its nesting, field types, and rules for omitted fields versus explicit nulls.
Start with the event contract for the code you are testing: what value goes at the root, where each field lives, and what type it takes. In our order event, the root is an object with an order field. That field holds an object containing id and items. Putting id at the root would leave it at the wrong path, even if the JSON parses.
An object uses braces and gives its members double-quoted names. An array uses brackets and holds values in order. Here, items is an array of objects, each with a string sku and a numeric quantity. Check types at the leaves too: "007" preserves the order ID as a string, while 2 is a number and "2" is not. Use double quotes for strings, and leave out comments and trailing commas.
Next up: Sort the statements on what you just read.