Validation Rules Reference¶
Items
required¶
Verify whether the value is entered. Error is returned when the parameter does not exist or in case of the null character.
Verification is not done when the value is set to false.
Set value¶
true or false
Example¶
required: true
Error Message¶
Locale | Error Message |
---|---|
en | {0} is required. |
ja | {0}は必須です。 |
zh_CN | {0}为必须项目。 |
alpha¶
Verify whether the value is in alphabet. Error is returned when a character other than the alphabet is found.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
Set value¶
true or false
Example¶
alpha: true
Error Message¶
Locale | Error Message |
---|---|
en | {0} should be in alphabets. |
ja | {0}は英字である必要があります。 |
zh_CN | {0}必须为英文字母。 |
alphanumeric¶
Verify whether the value is in alphabet or numbers. Error is returned when a character other than the alphabet or number is found.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
Set value¶
true or false
Example¶
alphanumeric: true
Error Message¶
Locale | Error Message |
---|---|
en | {0} should be in alphanumeric. |
ja | {0}は英数字である必要があります。 |
zh_CN | {0}必须为英文字母和数字。 |
numeric¶
Verify whether the value is in number. Error is returned when a character other than the number is found.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
Set value¶
true or false
Example¶
numeric: true
Error Message¶
Locale | Error Message |
---|---|
en | {0} should be a number. |
ja | {0}を複数指定することはできません。 |
zh_CN | {0}必须为数字。 |
digits¶
Verify the integers and decimal digits of the number. Error is returned when the number is bigger than the specified digits.
Verification is not done when the parameter does not exist or the value is blank.
Set value¶
[Number1, Number2]
- Number1 - Maximum digits of integers
- Number2 - Maximum digits of small number
Example¶
digits: [3, 2]
Error Message¶
Locale | Error Message |
---|---|
en | {0} should be between integer of digit {1} and small number of digit {2}. |
ja | {0}は{1}桁の整数、及び{2}桁の少数の範囲である必要があります。 |
zh_CN | {0}必须在{1}位整数、{2}位小数的范围内。 |
lowercase¶
It verifies whether the value is in lower case alphabet. Error is returned when a character other than the lower case alphabets is found.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
Set value¶
true or false
Example¶
lowercase: true
Error Message¶
Locale | Error Message |
---|---|
en | {0} should contain lower case alphabets. |
ja | {0}には英字かつ小文字である必要があります。 |
zh_CN | {0}必须为英文小写字母。 |
uppercase¶
Verify whether the value is in upper case alphabets. Error is returned when the character other than the upper case alphabets is found.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
Set value¶
true or false
Example¶
uppercase: true
Error Message¶
Locale | Error Message |
---|---|
en | {0} should contain upper case alphabet. |
ja | {0}には英字かつ大文字である必要があります。 |
zh_CN | {0}必须为英文大写字母。 |
integer¶
Verify whether the value is integer. Error is returned when the number is not integer.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
Set value¶
true or false
Example¶
integer: true
Error Message¶
Locale | Error Message |
---|---|
en | {0} should be an integer. |
ja | {0}は整数でなければなりません。 |
zh_CN | {0}必须为整数。 |
decimal¶
Verify whether the value is a real number. Error is returned when the number is not real.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
Set value¶
true or false
Example¶
decimal: true
Error Message¶
Locale | Error Message |
en | {0} must be a number. |
ja | {0}は数値でなければなりません。 |
zh_CN | {0}必须为数值。 |
minlength¶
Verify the minimum number of characters of the value. Error is returned when the number of characters is lesser than the specified length.
Verification is not done when the parameter does not exist or the value is blank.
Set value¶
Number
Example¶
minlength: 6
Error Message¶
Locale | Error Message |
en | {0} should be more than {1} character. |
ja | {0}は{1}文字以上でなければなりません。 |
zh_CN | {0}必须为{1}个字符以上。 |
maxlength¶
Verify the maximum number of characters of the value. Error is returned when the number of characters is higher than the specified length.
Verification is not done when the parameter does not exist or the value is blank.
Set value¶
Number
Example¶
maxlength: 50
Error Message¶
Locale | Error Message |
en | {0} should be less than {1} character. |
ja | {0}は{1}文字以内でなければなりません。 |
zh_CN | {0}必须在{1}个字符以内。 |
min¶
Verify the minimum value of the number. Error is returned when the value is lesser than the set value.
Verification is not done when the parameter does not exist or the value is blank.
Set value¶
Number
Example¶
min: 6
Error Message¶
Locale | Error Message |
en | {0} should be a number greater than {1}. |
ja | {0}は{1}以上の数値である必要があります。 |
zh_CN | {0}必须为{1}以上的数值。 |
max¶
Verify the maximum value of the number. Error is returned when the value is higher than the set value.
Verification is not done when the parameter does not exist or the value is blank.
Set value¶
Number
Example¶
max: 6
Error Message¶
Locale | Error Message |
en | {0} should be a number less than {1}. |
ja | {0}は{1}以下の数値である必要があります。 |
zh_CN | {0}必须为{1}以下的数值。 |
range¶
Verify the range of the numbers. Error is returned when the value is higher or leser than the set value.
Verification is not done when the parameter does not exist or the value is blank.
Example¶
range: [0, 12]
Error Message¶
Locale | Error Message |
en | {0} should be between {1} and {2}. |
ja | {0}は{1}から{2}までの範囲である必要があります。 |
zh_CN | {0}必须在{1}至{2}的范围内。 |
email¶
Verify whether the value is in e-mail address format. Error is returned when the value is not in the e-mail address format.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
The value given below is recognized as the e-mail address.
foo@example.com
foo.bar@baz.org
aaa@bbb.ccc
It will not be recognized as the e-mail address, when there are consecutive dots or a dot just before the “@” mark.
foo..bar@baz.org
foo.@bar.org
Set value¶
true or false
Example¶
email: true
Error Message¶
Locale | Error Message |
en | {0} should be in the form of mail address. |
ja | {0}はメールアドレス形式である必要があります。 |
zh_CN | {0}必须为邮件地址形式。 |
url¶
Verify whether the value is in URL format. Error is returned when the value is not in the URL format.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
The value given below is recognized as the URL.
http://example.com
https://foo.com
http://aaa.org:8080/bbb/ccc/
ftp://example.com
Set value¶
true or false
Example¶
url: true
Error Message¶
Locale | Error Message |
en | {0} should be in URL format. |
ja | {0}はURL形式である必要があります。 |
zh_CN | {0}必须为URL形式。 |
equals¶
Verify whether the value is equal to the set value. Error is returned when the value is not equal to the set value.
Verification is not done when the parameter does not exist or the value is blank.
Set value¶
String
Example¶
equals: 'foo'
Error Message¶
Locale | Error Message |
en | {0} should be equal to {1}. |
ja | {0}は{1}と等しくなければなりません。 |
zh_CN | {0}必须与{1}相等。 |
contains¶
Verify whether the value contains the string of the set value. Error is returned when the value does not contain the string of set value.
Verification is not done when the parameter does not exist or the value is blank.
Set value¶
String
Example¶
contains: 'foo'
Error Message¶
Locale | Error Message |
en | {0} should contain {1}. |
ja | {0}には{1}が含まれている必要があります。 |
zh_CN | {0}中必须包含{1}。 |
isIn¶
Verify whether the value matches with the string of the set value. Error is returned when the value does not match with the set value.
Verification is not done when the parameter does not exist.
Set value¶
[String1, String2,...]
Example¶
isIn: ['foo', 'bar', 'baz']
Error Message¶
Locale | Error Message |
en | {0} should have either of [{1}]. |
ja | {0}には[{1}]のうちいずれかが含まれている必要があります。 |
zh_CN | {0}中必须包含[{1}]中某一项目。 |
regex¶
Verify whether the value matches with the regular expression. Error is returned when the value does not match with the regular expression.
Verification is not done when the parameter does not exist.
Set value¶
Regular Expression Object
Example¶
regex: /^[a-zA-Z0-9]+$/
Error Message¶
Locale | Error Message |
en | Format of {0} is not correct. |
ja | {0}の形式が正しくありません。 |
zh_CN | {0}必须在{1}至{2}的范围内。 |
file¶
Verify whether the value is file upload. Error is returned when the value is not file upload.
Verification is not done when the parameter does not exist.
Verification is not done when the value is set to false.
Set value¶
true or false
Example¶
file: true
Error Message¶
Locale | Error Message |
en | {0} is not a file. |
ja | {0}がファイルではありません。 |
zh_CN | {0}不是文件。 |
mimeType¶
By distinguishing the MIME Type from the file contents, verify whether the value is in accordance with the condition mentioned in the set value. Error is returned when the value is not in accordance with the condition.
Verification is not done when the parameter does not exist.
Set value¶
{
include: [String, String,...],
exclude: [String, String,...]
}
- include - Allowed MIME Type
- exclude - Excluded MIME Type
Example¶
mimeType: {
include: ['text/html', 'application/msword'],
exclude: ['application/octet-stream']
}
Error Message¶
Locale | Error Message |
en | {0} has file format not allowed. |
ja | {0}は許可されていないファイル形式です。 |
zh_CN | {0}为未经许可的文件格式。 |
id¶
Verify whether the value is in ID, code system.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
ID, code system should be configured with the following characters. Error is returned when characters other than these are found.
- Single byte alphabets (a-z) (A-Z)
- Single byte number (0-9)
- Underscore (_)
- Dash (-)
- at mark (@)
- Dot (.)
- Plus (+)
- Exclamation mark (!)
Set value¶
true or false
Example¶
id: true
Error Message¶
Locale | Error Message |
en | {0} should be in ID format. |
ja | {0}はID形式である必要があります。 |
zh_CN | {0}必须为ID形式。 |
userCd¶
Verify whether the value is in user code.
Verification is not done when the parameter does not exist or the value is blank.
Verification is not done when the value is set to false.
User code should be configured with the following characters. Error is returned when characters other than these are found.
- Single byte alphabets (a-z) (A-Z)
- Single byte number (0-9)
- Underscore (_)
- Dash (-)
- at mark (@)
- Dot (.)
- Plus (+)
- Exclamation mark (!)
Set value¶
true or false
Example¶
userCd: true
Error Message¶
Locale | Error Message |
en | {0} should be in user code format. |
ja | {0}はユーザコード形式である必要があります。 |
zh_CN | {0}必须为用户代码形式。 |