interface ParameterValidationRule
This function is an inner wrapper for ParameterTypeValidator inside ValidationHandler parameter maps. Don't instantiate this class, if you want to add custom ParameterTypeValidator to a parameter use functions in HTTPRequestValidationHandler
Author
Francesco Guardiani @slinkydeveloper
abstract fun allowEmptyValue(): Boolean
allowEmptyValue is used in query, header, cookie and form parameters. This is its behaviour:
|
|
abstract fun getName(): String
This function return the name of the parameter expected into parameter lists |
|
abstract fun isOptional(): Boolean
Return true if parameter is optional |
|
abstract fun parameterTypeValidator(): ParameterTypeValidator
Return ParameterTypeValidator instance used inside this parameter validation rule |
|
abstract fun validateArrayParam(value: MutableList<String>): RequestParameter
This function will be called when there is a List that need to be validated. It must check if array is expected or not. It will throw a ValidationError in an error during validation occurs |
|
abstract fun validateSingleParam(value: String): RequestParameter
This function will be called when there is only a string as parameter. It will throw a ValidationError in an error during validation occurs |