How to validate web api response
<p>I am working on a web api where I need to validate response returned. I want to write some generic code to ensure that response returned from api is in a correct format.</p>

<p>Basically there are fields like status, remarks etc which should be present in response if these are null or invalid then i should return some error code but not sure how to achieve this, can someone guide me here? Thanks in advance.</p>

<p>Thanks,
Sudama</p>