mirror of
https://github.com/tristanpenman/valijson.git
synced 2025-11-18 20:28:15 +01:00
This commit contains the third major design of a C++ library for JSON Schema validation. It is definitely not what I would consider production-ready, but I do think that the overall design of the library is robust.
40 lines
1.0 KiB
JSON
Executable File
40 lines
1.0 KiB
JSON
Executable File
[
|
|
{
|
|
"description": "simple enum validation",
|
|
"schema": {"enum": [1, 2, 3]},
|
|
"tests": [
|
|
{
|
|
"description": "one of the enum is valid",
|
|
"data": 1,
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "something else is invalid",
|
|
"data": 4,
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "heterogeneous enum validation",
|
|
"schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
|
|
"tests": [
|
|
{
|
|
"description": "one of the enum is valid",
|
|
"data": [],
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "something else is invalid",
|
|
"data": null,
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "objects are deep compared",
|
|
"data": {"foo": false},
|
|
"valid": false
|
|
}
|
|
]
|
|
}
|
|
]
|