Closed karenetheridge closed 4 years ago
I have created a separate PR for the first change. That commit is still contained in this PR as the code change is also needed here, but it will rebase away when it is merged to master.
@expected
is removed in the _validate_(all|any|one)_of
subs because it doesn't actually help anything -- the _validate
call already did the type check and returned the proper error, and also schema_type
can't return a useful result in the cases where type => ..
is a list of types.
We don't actually need to do anything extra at all at the end of these subs if we don't care about joining all the type
errors into one -- the code gets much simpler if instead of:
E('/', '/anyOf/1 Expected integer/boolean - got string.');
we can return:
E('/', '/anyOf/1 Expected integer - got string.'),
E('/', '/anyOf/1 Expected boolean - got string.');
Thanks for all the changes 👍
Summary
fixes more edge cases with oneOf
Motivation
Many of the new tests I added will fail without the accompanying code changes.