below is my json schema :
{
"BRK.A": [
{
"time": "20231204T0930",
"opn": -102.49,
"hi": 1362.995704,
"lo": 54.1,
"cl": 1362.995704,
"vl": 2421
},
{
"time": "20231204T0945",
"opn": 988.11,
"hi": 834.120704,
"lo": 608.51,
"cl": 651.650704,
"vl": 2908
}
]
}
opn has a negative value which is invalid.
So I would like to add a test to check for any negative values in response during schema validation.
I tried to add “minimum” in schema validation like below but it does not work.
const schema = {
"type": "object",
"properties": {
"": {
"type": "array",
"items": {
"type": "object",
"properties": {
"time": {
"type": "string"
},
"opn": {
"type": "number",
"minimum": 0
}
},
"required": [
"time",
"opn",
"hi",
"lo",
"cl",
"vl"
]
}
}
}
}
Please help add schema validation for this.