API monitoring
Track JSON responses for schema or value changes with structure-aware hashing.
API monitoring
Keep partner and internal APIs honest by hashing normalized JSON and alerting on structural drift.
JSON normalization
- Responses are parsed to JSON.
- Ignore paths are applied before hashing to skip known volatile fields.
- Content hashes are stable even if key order changes.
const parsed = JSON.parse(bodyText);
const paths = parseIgnoreJsonPathsStrict(monitor.ignoreJsonPaths);
const filtered = applyIgnoreJsonPaths(parsed, paths);
const hashInput = stableStringify(filtered.value);
const contentHash = hash(hashInput);Use cases
- Track contract changes before a new version ships.
- Verify third-party feeds stay compatible.
- Catch breaking changes in staging before they hit production.
Error handling
Non-JSON responses are marked UNEXPECTED_MIME so you can fix the upstream or adjust ignore rules.