As part of contract tests I have to validate json response I got from rest-endpoint against json-schema present in a file. I'm using NJsonSchema and was not able to perform this.
Json-schema in file is as something below
{
'type': 'object',
'properties': {
'remaining': {
'type': 'integer',
'required': true
},
'shuffled': {
'type': 'boolean',
'required': true
}
'success': {
'type': 'boolean',
'required': true
},
'deck_id': {
'type': 'string',
'required': true
}
}
}
Json I have to validate is something like below
{ 'remaining': 52, 'shuffled': true, 'success': true, 'deck_id': 'b5wr0nr5rvk4'}
Can anyone please throw some light (with examples) on how to validate json with jsonschema using NJsonSchema or Manatee.Json.