interface HTTPRequestValidationHandler : ValidationHandler
An interface for add HTTP Request validation. This class can validate parameters inside query, path, headers an body (watch below) You can assign multiple body type at the same time(for example a JSON schema together with a XML schema). This interface support:
Author
Francesco Guardiani @slinkydeveloper
abstract fun addCustomValidatorFunction(customValidator: CustomValidator): HTTPRequestValidationHandler
Add a custom validator. For more informations about custom validator, see CustomValidator |
|
abstract fun addExpectedContentType(contentType: String): HTTPRequestValidationHandler
Add an expected content type of request. It's not needed to add application/json, application/xml, multipart/form-data and application/x-www-form-urlencoded |
|
abstract fun addFormParam(parameterName: String, type: ParameterType, required: Boolean): HTTPRequestValidationHandler
Add a single parameter inside a form with included parameter types |
|
abstract fun addFormParamWithCustomTypeValidator(parameterName: String, validator: ParameterTypeValidator, required: Boolean, allowEmptyValue: Boolean): HTTPRequestValidationHandler
Add a form parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check out ParameterTypeValidator |
|
abstract fun addFormParamWithPattern(parameterName: String, pattern: String, required: Boolean): HTTPRequestValidationHandler
Add a single parameter inside a form with a custom pattern |
|
abstract fun addFormParamsArray(parameterName: String, type: ParameterType, required: Boolean): HTTPRequestValidationHandler
Add a form parameters array with included parameter types |
|
abstract fun addFormParamsArrayWithPattern(parameterName: String, pattern: String, required: Boolean): HTTPRequestValidationHandler
Add a form parameters array with a custom pattern |
|
abstract fun addHeaderParam(headerName: String, type: ParameterType, required: Boolean): HTTPRequestValidationHandler
Add a header parameter with included parameter types |
|
abstract fun addHeaderParamWithCustomTypeValidator(headerName: String, validator: ParameterTypeValidator, required: Boolean, allowEmptyValue: Boolean): HTTPRequestValidationHandler
Add a header parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check out ParameterTypeValidator |
|
abstract fun addHeaderParamWithPattern(headerName: String, pattern: String, required: Boolean): HTTPRequestValidationHandler
Add a header parameter with a custom pattern |
|
abstract fun addJsonBodySchema(jsonSchema: String): HTTPRequestValidationHandler
Add a json schema for body with Content-Type "application/json" |
|
abstract fun addMultipartRequiredFile(filename: String, contentType: String): HTTPRequestValidationHandler
Add an expected filename inside multipart request. |
|
abstract fun addPathParam(parameterName: String, type: ParameterType): HTTPRequestValidationHandler
Add a path parameter with included parameter types. All path params are required |
|
abstract fun addPathParamWithCustomTypeValidator(parameterName: String, validator: ParameterTypeValidator, allowEmptyValue: Boolean): HTTPRequestValidationHandler
Add a path parameter with a custom type validator. All path params are required. For more informations about how to construct built-in or custom type validator, check out ParameterTypeValidator |
|
abstract fun addPathParamWithPattern(parameterName: String, pattern: String): HTTPRequestValidationHandler
Add a path parameter with a custom pattern. All path params are required |
|
abstract fun addQueryParam(parameterName: String, type: ParameterType, required: Boolean): HTTPRequestValidationHandler
Add a query parameter with included parameter types |
|
abstract fun addQueryParamWithCustomTypeValidator(parameterName: String, validator: ParameterTypeValidator, required: Boolean, allowEmptyValue: Boolean): HTTPRequestValidationHandler
Add a query parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check out ParameterTypeValidator |
|
abstract fun addQueryParamWithPattern(parameterName: String, pattern: String, required: Boolean): HTTPRequestValidationHandler
Add a query parameter with a custom pattern |
|
abstract fun addQueryParamsArray(arrayName: String, type: ParameterType, required: Boolean): HTTPRequestValidationHandler
Add a query parameters array with included parameter types |
|
abstract fun addQueryParamsArrayWithPattern(arrayName: String, pattern: String, required: Boolean): HTTPRequestValidationHandler
Add a query parameters array with a custom pattern |
|
abstract fun addXMLBodySchema(xmlSchema: String): HTTPRequestValidationHandler
Add a xml schema for body with Content-Type "application/xml" |
|
open static fun create(): HTTPRequestValidationHandler
Factory method to create an HTTPRequestValidationHandler |