Closed cmawhorter closed 6 years ago
These should fail against null, but don't because undefined means there is nothing to validate against. It will fail properly if you set keys as required and pass undefined.
I see this behavior in json schema validation as well.
That's not a final answer but first thoughts.
At the end of this day, this behavior is based on Joi. These properties are not necessarily required, but Joi passes validation because they are not marked as required. I don't think there is anything to fix here.
All types are incorrectly reporting
undefined
as valid. Array is the exception because of #33No ValidationError for any of those and the value returned is
undefined
.(Sorry for the deluge!)