Open moll opened 9 years ago
Hi. The issue is that the validator
function can work with both a schema object, and an array of schemas. It's is a minor inconvenience though :)
Mkay, then validator
could return different types of validate functions depending on whether given an array or not, right?
@moll, I think returning different types of validate functions makes sense. You can open a pull request for the same and I'll merge it.
Actually I was working on this (the first proposal, of allowing the retrieval of a lone schema), but seems like it's not going to be as trivial as I first presumed... especially, as the _schemas
object keeps changing, and the sub-schemas are added to the original schema list passed by the user.
Hey,
When I create a simple anonymous schema (without an explicit "id"), I've got to call its validate function with a fake
"0"
as the schema name. Could this implementation detail be hidden to just allow calling the function with an object and without a name?Thanks!