JSON Field Presence Validation
Verify your API returns expected data.
An API can return 200 OK while omitting essential fields. JSON structure validation ensures the response contains the data you expect.
Detect regressions and API changes before they impact your application.
Why Validate Fields
- Regression detection: a deployment can accidentally remove a field from the JSON.
- Breaking changes: third-party APIs may modify their structure without notice.
- Silent errors: a null or missing field can break your logic without HTTP error.
MoniTao Configuration
- JSONPath: use $.data.user.id to verify presence of a nested field.
- Exists assertion: configure an assertion that the field exists (not null, not undefined).
- Alerts: get alerted if the JSON structure changes.
Frequently Asked Questions
What JSONPath syntax to use?
MoniTao supports standard JSONPath syntax: $.field, $.array[0], $.nested.field.
Can I validate multiple fields?
Yes, add multiple JSONPath assertions in the same monitor.
How to handle optional fields?
Only validate required fields. Optional ones may be absent.
Does JSONPath validation impact performance?
No, JSON parsing is very fast and doesn't add significant latency.
Useful Links
Ready to Sleep Soundly?
Start free, no credit card required.