Testing payload structure using JSON schema
-
Easy
-
20 min
I'll tell you about a cheap, simple and effective way to validate the payload structure of requests/responses/messages in JSON format.
We will learn how to identify payload structure problems such as:
- missing required properties in objects;
- typos in keys;
- extra (unexpected) properties in structures;
- unexpected duplicates in the arrays;
- values don't match expected data types;
- string values don't match expected patterns;
- values out of the acceptable limits, etc.