@bpricilla How will a validate of my whole JSON response array of objects have more than 350 objects.
I want to check the whole response body has a parameter with datatype.
Ya could you tell me what will be the best practice for this.
currently, I m converting JSON response from the swagger doc and in postman that response body i m storing in a variable like this…
var schema=
{
“type”: “array”,
“items”: [
{
“type”: “object”,
“properties”: {
“modifiedOn”: {
“type”: “string”
},
“id”: {
“type”: “string”
},
“header”: {
“type”: “string”
},
“content”: {
“type”: “string”
},
“wordsCount”: {
“type”: “integer”
},
},
"required": [
"modifiedOn",
"id",
"header",
"content",
"wordsCount",
]
}
]
};
pm.test(“Validate response body”, function() {
pm.response.to.have.jsonSchema(schema);
});
