Path: blob/main/external/libucl/tests/schema/dependencies.json
2066 views
[1{2"description": "dependencies",3"schema": {4"dependencies": {"bar": ["foo"]}5},6"tests": [7{8"description": "neither",9"data": {},10"valid": true11},12{13"description": "nondependant",14"data": {"foo": 1},15"valid": true16},17{18"description": "with dependency",19"data": {"foo": 1, "bar": 2},20"valid": true21},22{23"description": "missing dependency",24"data": {"bar": 2},25"valid": false26},27{28"description": "ignores non-objects",29"data": "foo",30"valid": true31}32]33},34{35"description": "multiple dependencies",36"schema": {37"dependencies": {"quux": ["foo", "bar"]}38},39"tests": [40{41"description": "neither",42"data": {},43"valid": true44},45{46"description": "nondependants",47"data": {"foo": 1, "bar": 2},48"valid": true49},50{51"description": "with dependencies",52"data": {"foo": 1, "bar": 2, "quux": 3},53"valid": true54},55{56"description": "missing dependency",57"data": {"foo": 1, "quux": 2},58"valid": false59},60{61"description": "missing other dependency",62"data": {"bar": 1, "quux": 2},63"valid": false64},65{66"description": "missing both dependencies",67"data": {"quux": 1},68"valid": false69}70]71},72{73"description": "multiple dependencies subschema",74"schema": {75"dependencies": {76"bar": {77"properties": {78"foo": {"type": "integer"},79"bar": {"type": "integer"}80}81}82}83},84"tests": [85{86"description": "valid",87"data": {"foo": 1, "bar": 2},88"valid": true89},90{91"description": "no dependency",92"data": {"foo": "quux"},93"valid": true94},95{96"description": "wrong type",97"data": {"foo": "quux", "bar": 2},98"valid": false99},100{101"description": "wrong type other",102"data": {"foo": 2, "bar": "quux"},103"valid": false104},105{106"description": "wrong type both",107"data": {"foo": "quux", "bar": "quux"},108"valid": false109}110]111}112]113114115