Skip to content
Peter Svetlichny edited this page Aug 3, 2015 · 3 revisions

Validation for string types


maxLength


maxlength validation

Schema

"schema": {"maxLength": 2}

API

var schema = json.maxLength(2);

minLength


minLength validation

Schema

"schema": {"minLength": 2}

API

var schema = json.minLength(2);

pattern


pattern validation

Schema

"schema": {"pattern": "^a*$"}

API

var schema = json.pattern('^a*$');