Closed lumag closed 6 months ago
That's defined behavior of json-schema. A not present property's schema will be true. Otherwise, that would be the property is required or the whole schema would fail. If a property cannot be assumed to be present, you also need {required: [propname]} in the 'if' schema.
Usually we don't need required in the if/then, because we can assume 'compatible' is present as we don't apply the schema at all if it is not.
I see, thank you for the explanation.
Reproducer: linux-next (e.g. 20240429).
make ARCH=arm64 qcom/apq8016-sbc.dtb CHECK_DTBS=y DT_SCHEMA_FILES=qcom,pmic-gpio.yaml
I'm currently getting the following error:
With the https://lore.kernel.org/linux-arm-msm/20240425185603.3295450-1-quic_amelende@quicinc.com/ I can no longer reproduce the issue. However the patch fixes a branch which should be false anyway.
I was able to limit it to the following reproducer:
Note, changing
allOf
tooneOf
results in the following warning, which shows that second branch evaluated to true:cc @krzk