- Rename fixtures/items.json to fixtures/array.json to better reflect array testing constraints. - Update reference paths in src/tests/fixtures.rs and across other fixture JSON files. - Remove unused HashMap import in src/validator/rules/dict.rs to resolve the compiler warning.
81 lines
1.8 KiB
JSON
81 lines
1.8 KiB
JSON
[
|
|
{
|
|
"description": "exclusiveMaximum validation",
|
|
"database": {
|
|
"types": [
|
|
{
|
|
"name": "exclusiveMaximum_0_0",
|
|
"schemas": {
|
|
"exclusiveMaximum_0_0": {
|
|
"exclusiveMaximum": 3
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "below the exclusiveMaximum is valid",
|
|
"data": 2.2,
|
|
"schema_id": "exclusiveMaximum_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "boundary point is invalid",
|
|
"data": 3,
|
|
"schema_id": "exclusiveMaximum_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": false,
|
|
"errors": [
|
|
{
|
|
"code": "EXCLUSIVE_MAXIMUM_VIOLATED",
|
|
"values": {
|
|
"limit": "3",
|
|
"value": "3"
|
|
},
|
|
"details": {
|
|
"path": "",
|
|
"schema": "exclusiveMaximum_0_0"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"description": "above the exclusiveMaximum is invalid",
|
|
"data": 3.5,
|
|
"schema_id": "exclusiveMaximum_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": false,
|
|
"errors": [
|
|
{
|
|
"code": "EXCLUSIVE_MAXIMUM_VIOLATED",
|
|
"values": {
|
|
"limit": "3",
|
|
"value": "3.5"
|
|
},
|
|
"details": {
|
|
"path": "",
|
|
"schema": "exclusiveMaximum_0_0"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"description": "ignores non-numbers",
|
|
"data": "x",
|
|
"schema_id": "exclusiveMaximum_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
}
|
|
]
|
|
}
|
|
] |