API JSON response contract
156-api-json-contract.yaml
Infrastructure
What this example does
API JSON response contract.
Checks and behavior
- Checks selected JSON paths rather than a complete JSON Schema.
Replace example.com, documentation IPs, secrets and thresholds before production use.
YAML configuration
# Checks selected JSON paths rather than a complete JSON Schema.
name: API JSON response contract
url: https://api.example.com/health
request: {method: GET}
tests:
status: {allow: [200]}
json:
paths:
- {path: status, equals: healthy}
- {path: version, exists: true}
monitoring: {output: nagios, on_failure: critical}