HTTPRequestValidationHandler

An interface for add HTTP Request validation. This class can validate parameters inside query, path, headers an body (watch below) <br/> You can assign multiple body type at the same time(for example a JSON schema together with a XML schema). This interface support: <ul> <li>application/x-www-form-urlencoded</li> <li>multipart/form-data</li> <li>application/xml</li> <li>application/json</li> </ul> Also you can add a form parameter for validation without care about content type of your request. For form parameters this interface support both "multipart/form-data" and "application/x-www-form-urlencoded" <br/> This interface allow extra parameters in the request, so it doesn't care if in a request there's a parameter without a specified validation rule <br/> If a parameter is flagged as an array, it will be validated also if the size of array is 1 element

package

Default

Methods

__construct

__construct() 

Add a custom validator. For more informations about custom validator, see @see \io\vertx\jphp\ext\web\api\validation\CustomValidator

addCustomValidatorFunction( $arg0) : $this

Arguments

$arg0

CustomValidator

Response

$this

this handler

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

addExpectedContentType( $arg0) : $this

Arguments

$arg0

string

Response

$this

this handler

Add a single parameter inside a form with included parameter types

addFormParam( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a form parameters array with included parameter types

addFormParamsArray( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a form parameters array with a custom pattern

addFormParamsArrayWithPattern( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a form parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check out @see \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

addFormParamWithCustomTypeValidator( $arg0,  $arg1,  $arg2,  $arg3) : $this

Arguments

$arg0

string

$arg1

ParameterTypeValidator

$arg2

boolean

$arg3

boolean

Response

$this

this handler

Add a single parameter inside a form with a custom pattern

addFormParamWithPattern( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a header parameter with included parameter types

addHeaderParam( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a header parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check out @see \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

addHeaderParamWithCustomTypeValidator( $arg0,  $arg1,  $arg2,  $arg3) : $this

Arguments

$arg0

string

$arg1

ParameterTypeValidator

$arg2

boolean

$arg3

boolean

Response

$this

this handler

Add a header parameter with a custom pattern

addHeaderParamWithPattern( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a json schema for body with Content-Type "application/json"

addJsonBodySchema( $arg0) : $this

Arguments

$arg0

string

Response

$this

this handler

Add an expected filename inside <b>multipart request</b>.

addMultipartRequiredFile( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

string

Response

$this

this handler

Add a path parameter with included parameter types. All path params are <b>required</b>

addPathParam( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

string

Response

$this

this handler

Add a path parameter with a custom type validator. All path params are <b>required</b>. For more informations about how to construct built-in or custom type validator, check out @see \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

addPathParamWithCustomTypeValidator( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

ParameterTypeValidator

$arg2

boolean

Response

$this

this handler

Add a path parameter with a custom pattern. All path params are <b>required</b>

addPathParamWithPattern( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

string

Response

$this

this handler

Add a query parameter with included parameter types

addQueryParam( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a query parameters array with included parameter types

addQueryParamsArray( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a query parameters array with a custom pattern

addQueryParamsArrayWithPattern( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a query parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check out @see \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

addQueryParamWithCustomTypeValidator( $arg0,  $arg1,  $arg2,  $arg3) : $this

Arguments

$arg0

string

$arg1

ParameterTypeValidator

$arg2

boolean

$arg3

boolean

Response

$this

this handler

Add a query parameter with a custom pattern

addQueryParamWithPattern( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

$this

this handler

Add a xml schema for body with Content-Type "application/xml"

addXMLBodySchema( $arg0) : $this

Arguments

$arg0

string

Response

$this

this handler

Factory method to create an HTTPRequestValidationHandler

create() : \io\vertx\jphp\ext\web\api\validation\HTTPRequestValidationHandler
static

Something has happened, so handle it.

handle( $arg0) : void

Arguments

$arg0

RoutingContext