xref: /freebsd/contrib/libucl/tests/schema/required.json (revision 39ee7a7a6bdd1557b1c3532abf60d139798ac88b)
1[
2    {
3        "description": "required validation",
4        "schema": {
5            "properties": {
6                "foo": {},
7                "bar": {}
8            },
9            "required": ["foo"]
10        },
11        "tests": [
12            {
13                "description": "present required property is valid",
14                "data": {"foo": 1},
15                "valid": true
16            },
17            {
18                "description": "non-present required property is invalid",
19                "data": {"bar": 1},
20                "valid": false
21            }
22        ]
23    },
24    {
25        "description": "required default validation",
26        "schema": {
27            "properties": {
28                "foo": {}
29            }
30        },
31        "tests": [
32            {
33                "description": "not required by default",
34                "data": {},
35                "valid": true
36            }
37        ]
38    }
39]
40