Closed devlucasc closed 4 years ago
Hi, thanks for using Yamale.
The any
validator will return true if at least one of the validators match. When running in strict mode, none of the validators you've defined will match. And when not running in strict mode, v1
would always match. But you've figured that out.
There was a similar request for a conditional schema validator, you can read my thoughts about that here: https://github.com/23andMe/Yamale/issues/71#issuecomment-549932853
So I think you've found the best way to handle your case in the final iteration of your schema.
Let me know if you have any other questions.
I can't validate a schema like this: Data 1:
Data 2:
Schema:
I was only able to do that when I duplicated schema like this:
This occurs because validator in any operator are validated separately. I would like to make a conditional schema validator, defined by the type field