My question:
I am not sure why postman schema validation assert is failing.
Details (like screenshots):
Here is the test:
let jsonData = {
"studentAssetExceeded": null,
}
var schema = {
"type": "object",
"properties": {
"studentAssetExceeded": {
"title": "StudentAssetExceeded",
"maxLength": 5,
"type": "boolean",
"nullable": true,
"description": "Student asset threshold exceeded.",
"x-lineageReferenceObject": "FAPR.S.ASSET.THOLD.EXC"
}
}
}
pm.test('AUTO009 - The api request is schema compliant for post', () => {
pm.expect(jsonData).to.have.jsonSchema(schema);
});
Test Result:
AUTO009 - The api request is schema compliant for post | AssertionError: expected data to satisfy schema but found following errors: data.studentAssetExceeded should be boolean
Is there any way to address this error that the schema validation is throwing? The property studentAssetExceeded is nullable boolean. The schema validation works for true or false but not for null which is a valid input value.