A valid response can contain invalid meaning
An environmental API returns a number for temperature, but the field unexpectedly changes units. Schema validation helps ensure data structures and definitions remain consistent enough for safe interpretation.
Define the contract
Specify field names, data types, units, timestamp formats, identifiers and quality flags.
Validate required fields
Missing or null values should be handled according to documented rules rather than silently converted into misleading defaults.
Check ranges and meaning
A syntactically valid number may still be implausible or incompatible with the intended unit.
Test version changes
Breaking changes should be detected before downstream clients rely on the new format.
Preserve error transparency
Invalid responses should produce appropriate diagnostics and not masquerade as normal observations.
Monitor real-world failures
Validation should continue after deployment because upstream data and software can change.
Break-test: a field changes from Celsius to Fahrenheit without renaming
Can the system detect the semantic mismatch rather than accepting the numeric type alone?
Connected knowledge
See Environmental API Versioning, API Reliability and NEA.
