Reusing a validator in the same location in multiple parts of a union could lead to erroneously accepting invalid values, and also removing all properties from the returned objects
checks the input object against OuterObjectA. It sees it does not match key and does not match body. It collects the errors from this step.
checks the input object against OuterObjectB. It sees the key property is valid. It should see that the body property is not valid, but it was erroneously returning a cached "success" result from when the same InnerObject validator was applied to the same value as part of checking OuterObjectA.
Change Log for funtypes (5.0.1 → 5.0.2)
Bug Fixes
Reusing a validator in the same location in multiple parts of a union could lead to erroneously accepting invalid values, and also removing all properties from the returned objects
For example:
Funtypes:
OuterObjectA
. It sees it does not matchkey
and does not matchbody
. It collects the errors from this step.OuterObjectB
. It sees thekey
property is valid. It should see that thebody
property is not valid, but it was erroneously returning a cached "success" result from when the sameInnerObject
validator was applied to the same value as part of checkingOuterObjectA
.It now returns all the correct errors.
Edit changelog