scorpion.validation

Undocumented in source.

Members

Aliases

Email
alias Email = CustomValidation!(emailValidator)

Validates an email address using std.uri.emailLength.

Max
alias Max = CustomValidation!(maxValidator)

Validates a string only if its length is longer or equals to the given value.

Min
alias Min = CustomValidation!(minValidator)

Validates a string only if its length is shorter or equals to the given value.

NotEmpty
alias NotEmpty = CustomValidation!(notEmptyValidator)

Validates a string only if its length is higher than 0.

NotZero
alias NotZero = CustomValidation!(notZeroValidator)

Validates a number only if it's not 0.

Regex
alias Regex = CustomValidation!(regexValidator)

Validates a string using a regular expression.

Classes

Validation
class Validation

Validation utility class that contains errors.

Enums

ContentType
enum ContentType
Undocumented in source.
Optional
enum Optional

Indicates that the field is optional. This means that, if set to its initial state or not set, no validation will be done.

Functions

validateBody
T validateBody(ServerRequest request, ServerResponse response, Validation validation)
Undocumented in source. Be warned that the author may not have intended to support it.
validateParam
T validateParam(string param, ServerRequest request, ServerResponse response)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

CustomValidation
struct CustomValidation(alias func)

Creates a custom validator attribute. Note that due to a linker bug func cannot be a lambda.

Meta