You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ColdBox Validation Manager, all inspired by awesome Hyrule Validation Framework by Dan Vega.
8
-
9
-
When using constraints you can use {} values for replacements:
10
-
- {now} = today
11
-
- {property:name} = A property value
12
-
- {udf:name} = Call a UDF provider
13
-
14
-
Constraint Definition Sample:
15
-
constraints = {
16
-
propertyName = {
17
-
// required or not
18
-
required : boolean [false]
19
-
// type constraint
20
-
type : (ssn,email,url,alpha,boolean,date,usdate,eurodate,numeric,GUID,UUID,integer,[string],telephone,zipcode,ipaddress,creditcard,binary,component,query,struct,json,xml),
21
-
// size or length of the value (struct,string,array,query)
22
-
size : numeric or range, eg: 10 or 6..8
23
-
// range is a range of values the property value should exist in
24
-
range : eg: 1..10 or 5..-5
25
-
// regex validation
26
-
regex : valid no case regex
27
-
// same as another property
28
-
sameAs : propertyName
29
-
// same as but with no case
30
-
sameAsNoCase : propertyName
31
-
// value in list
32
-
inList : list
33
-
// discrete math modifiers
34
-
discrete : (gt,gte,lt,lte,eq,neq):value
35
-
// UDF to use for validation, must return boolean accept the incoming value and target object, validate(value,target):boolean
36
-
udf : function,
37
-
// Validation method to use in the targt object must return boolean accept the incoming value and target object, validate(value,target):boolean
38
-
method : methodName
39
-
// Custom validator, must implement
40
-
validator : path or wirebox id: 'mypath.MyValidator' or 'id:MyValidator'
* The ColdBox Validation Manager, all inspired by awesome Hyrule Validation Framework by Dan Vega.
8
+
*
9
+
* When using constraints you can use {} values for replacements:
10
+
* - {now} = today
11
+
* - {property:name} = A property value
12
+
* - {udf:name} = Call a UDF provider
13
+
*
14
+
* Constraint Definition Sample:
15
+
*
16
+
* <pre>
17
+
* constraints = {
18
+
* propertyName = {
19
+
* // required or not
20
+
* required : boolean [false]
21
+
* // type constraint
22
+
* type : (ssn,email,url,alpha,boolean,date,usdate,eurodate,numeric,GUID,UUID,integer,[string],telephone,zipcode,ipaddress,creditcard,binary,component,query,struct,json,xml),
23
+
* // size or length of the value (struct,string,array,query)
24
+
* size : numeric or range, eg: 10 or 6..8
25
+
* // range is a range of values the property value should exist in
26
+
* range : eg: 1..10 or 5..-5
27
+
* // regex validation
28
+
* regex : valid no case regex
29
+
* // same as another property
30
+
* sameAs : propertyName
31
+
* // same as but with no case
32
+
* sameAsNoCase : propertyName
33
+
* // value in list
34
+
* inList : list
35
+
* // discrete math modifiers
36
+
* discrete : (gt,gte,lt,lte,eq,neq):value
37
+
* // UDF to use for validation, must return boolean accept the incoming value and target object, validate(value,target):boolean
38
+
* udf : function,
39
+
* // Validation method to use in the targt object must return boolean accept the incoming value and target object, validate(value,target):boolean
40
+
* method : methodName
41
+
* // Custom validator, must implement
42
+
* validator : path or wirebox id: 'mypath.MyValidator' or 'id:MyValidator'
0 commit comments