I'm trying to develop a generic data validation engine for web forms. Basically, the idea is to write a library that loads a JSON "validation schema", and then generates the appropriate server-side and client-side validation rules for various data validation libraries.

It seems like everyone has their own set of validation rule names. For example, suppose you need to check that a string has a minimum number of characters. In the server-side library Valitron, the rule is called lengthMin. In the client-side library bootstrapvalidator, it's called stringLength.

My question is, is there any kind of standard out there (ANSI, ISO, etc) for the rule names and parameter names of common data validation rules?

closed as off-topic by gnat, Bart van Ingen Schenau, GlenH7, user40980, jwenting Sep 26 '14 at 12:44

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, Bart van Ingen Schenau, GlenH7, Community, jwenting
If this question can be reworded to fit the rules in the help center, please edit the question.

  • I wasn't asking for a recommendation. I was asking about the existence of a specific standard. – alexw Jan 8 '15 at 22:49
  • Well, after many months I have discovered that such a thing does exist: json-schema.org Too bad this question has been closed, or I could answer my question. – alexw Feb 10 '15 at 21:33

There are no standards for naming conventions by any major working group. The closest you might get would be standards within an organisation or for a particular product so you are effectively free to choose the names that you feel are best.

Maybe pick the best of some already great implementations (e.g. ActiveRecord Validations / Flask WTF etc.). You can't go wrong borrowing from them.

Not the answer you're looking for? Browse other questions tagged or ask your own question.