An API can return success while breaking its users
An environmental API responds normally but changes the meaning of a field. Downstream applications may display incorrect information without any visible error. Data contract testing checks structure and meaning before changes reach users.
Define the contract
Specify field names, types, units, timestamps, identifiers and quality indicators.
Test required and optional values
Missing, null and unusual values should follow documented behaviour.
Validate semantics
A temperature value with the wrong unit can pass a numeric type check while being operationally wrong.
Test version compatibility
Changes should be checked against supported client expectations and migration plans.
Include failure responses
Clients need consistent error messages and clear signals for unavailable or stale data.
Automate proportionately
Automated checks can catch repeated errors, while human review remains useful for changes in scientific meaning.
Break-test: a schema update silently renames a field
Can contract tests detect the breaking change before publication?
Connected knowledge
See API Schema Validation, API Versioning and NEA.