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

Changed the execution order of validations - conform, format, enum #115

Open alyyousuf7 opened 8 years ago

alyyousuf7 commented 8 years ago

Really appreciate your hard work on this module!

I heavily use conform, enum, format. And the current order of validation was causing me to write a lot of extra validations again and again.

There were cases where I used conform (and sometimes format) but first needed to check the length of the string. I had to write those validations manually in conform. So I decided to move conform, format, enum after string, number, etc validations.

Same goes for enums.