flatiron / revalidator

A cross-browser / node.js validator powered by JSON Schema
http://github.com/flatiron/revalidator
Apache License 2.0
589 stars 82 forks source link

Fix casting of empty strings to integers #94

Closed jeffutter closed 4 years ago

jeffutter commented 9 years ago

Before this patch if you cast an empty string to an integer it would not error on the field. (even with allowEmpty: false) . I'm not sure what the expected error message should be, but I suspect that it shouldn't be considered valid.

KWalle commented 9 years ago

Agree, in most cases I would think an empty string should not be treated as an integer (0). But maybe this could be passed in as an option?

jeffutter commented 9 years ago

Any hope of this being merged?