I'm writing a client application that receives a JSON response from a server. In the past I've run into situations where a developer on the server side changes the JSON response in a way that causes the client application to crash. An example of this is when the client expects that a JSON field or subobject will always be present, but a change on the server side causes the JSON to deviate from what is expected possibly returning a null value when null should never be a possible response.
It seem like the server side could always have unit tests that ensure that the JSON response fulfills the contract, but that's susceptible to human error if a developer decides to rewrite a test or simply makes a mistake in testing or misunderstands a requirement. The client side can check that the JSON response is valid, but this would need to occur at runtime and if the server is writing proper tests, the double-checking of the server response by the client would be unnecessary.
Is there a recommended process to ensure that the contract (JSON response format) between the client and server doesn't get broken?