Try validate JsonSchema in Json response by C#/Newtonsoft with method response.IsValid(schema, out IList<string> messages);
Looks like items from array are ignored.
I dont understand, why schema:
{
"type": "object",
"properties": {
"balance": {
"type": "number"
},
"bonuses": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"bonusAmount": {
"type": "number"
},
"bonusID": {
"type": "integer"
}
},
"required": [
"bonusAmount",
"bonusID"
]
}
]
}
},
"required": [
"balance",
"bonuses"
]
}
Valid for response { "balance": 40.0, "bonuses": [ ] }
I tried a few online validators as well and result the same - schema is valid for current response.