mafintosh / is-my-json-valid

A JSONSchema validator that uses code generation to be extremely fast
MIT License
965 stars 111 forks source link

Throw on invalid schema format #162

Open watson opened 6 years ago

watson commented 6 years ago

Prior to this change if your schema was in a Buffer, the validator would seem to work and pass all json as valid, but in reality it wasn't validating anything.

watson commented 6 years ago

This could maybe be improved by just calling toString() in case schema is a buffer...

LinusU commented 6 years ago

Very nice 👍

Unfortunately, I think that using the Buffer global will bring in the entire Buffer-polyfill when building this for the browser, could we use the is-buffer package instead?

Do you think that this should be a major or patch release? 🤔