public class RequestValidator extends Object implements io.vertx.lang.rx.RxDelegate
RequestValidator
requires the parameters
in a specific format to be able to
parse and validate them. This is especially true for exploded parameters. The following table shows how the
value of a parameter of a request must be stored in a ValidatableRequest
object. For these examples the key
of those values is always color.
These are the initial values for each type:ValidatedRequest.getCookies()
+--------+---------+-------+-----------+------------------------------------+-------------------------+ | style | explode | empty | primitive | array | object | +--------+---------+-------+-----------+------------------------------------+-------------------------+ | form | false | | blue | blue,black,brown | R,100,G,200,B,150 | +--------+---------+-------+-----------+------------------------------------+-------------------------+ | form | true | | blue | color=blue&color=black&color=brown | R=100&G=200&B=150 | +--------+---------+-------+-----------+------------------------------------+-------------------------+For header parameters
ValidatedRequest.getHeaders()
+--------+---------+-------+-----------+------------------------------------+-------------------------+ | style | explode | empty | primitive | array | object | +--------+---------+-------+-----------+------------------------------------+-------------------------+ | simple | false | | blue | blue,black,brown | R,100,G,200,B,150 | +--------+---------+-------+-----------+------------------------------------+-------------------------+ | simple | true | | blue | blue,black,brown | R=100,G=200,B=150 | +--------+---------+-------+-----------+------------------------------------+-------------------------+For path parameters
ValidatedRequest.getPathParameters()
+--------+---------+--------+-------------+-------------------------------------+--------------------------+ | style | explode | empty | primitive | array | object | +--------+---------+--------+-------------+-------------------------------------+--------------------------+ | simple | false | | blue | blue,black,brown | R,100,G,200,B,150 | +--------+---------+--------+-------------+-------------------------------------+--------------------------+ | simple | true | | blue | blue,black,brown | R=100,G=200,B=150 | +--------+---------+--------+------ ------+-------------------------------------+--------------------------+ | label | false | . | .blue | .blue,black,brown | .R,100,G,200,B,150 | +--------+---------+--------+-------------+-------------------------------------+--------------------------+ | label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150 | +--------+---------+--------+-------------+-------------------------------------+--------------------------+ | matrix | false | ;color | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150 | +--------+---------+-------+--------+-------------------------------------------+--------------------------+ | matrix | true | ;color | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150 | +--------+---------+--------+-------------+-------------------------------------+--------------------------+For query parameters
ValidatedRequest.getQuery()
+----------------+---------+-------+------------+-----------------------------------+--------------------------+ | style | explode | empty | primitive | array | object | +----------------+---------+-------+----------+-------------------------------------+--------------------------+ | form | false | | blue | blue,black,brown | R,100,G,200,B,150 | +----------------+---------+-------+-----------+------------------------------------+--------------------------+ | form | true | | blue | color=blue&color=black&color=brown | R=100&G=200&B=150 | +----------------+---------+-------+------ ----+------------------------------------+--------------------------+ | spaceDelimited | false | not yet supported / +----------------+---------+-------+------ ----+------------------------------------+--------------------------+ | spaceDelimited | true | not yet supported / +----------------+---------+-------+------ ----+------------------------------------+--------------------------+ | pipeDelimited | false | not yet supported / +----------------+---------+-------+------ ----+------------------------------------+--------------------------+ | pipeDelimited | true | not yet supported / +----------------+---------+-------+------ ----+------------------------------------+--------------------------+ | spaceDelimited | true | not yet supported / +----------------+---------+-------+------ ----+------------------------------------+--------------------------+
NOTE: This class has been automatically generated from the original
non RX-ified interface using Vert.x codegen.
Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<RequestValidator> |
__TYPE_ARG |
Constructor and Description |
---|
RequestValidator(Object delegate) |
RequestValidator(RequestValidator delegate) |
public static final io.vertx.lang.rx.TypeArg<RequestValidator> __TYPE_ARG
public RequestValidator(RequestValidator delegate)
public RequestValidator(Object delegate)
public RequestValidator getDelegate()
getDelegate
in interface io.vertx.lang.rx.RxDelegate
public static RequestValidator create(Vertx vertx, OpenAPIContract contract)
RequestValidator
.vertx
- the related Vert.x instancecontract
- the relatedRequestValidator
.public Future<ValidatedRequest> validate(HttpServerRequest request)
validate(io.vertx.reactivex.core.http.HttpServerRequest)
, but the operationId and ValidatableRequest
are
determined from the passed request.
Note: Determining the operationId is expensive. If possible use validate(io.vertx.reactivex.core.http.HttpServerRequest)
.request
- the request to validatepublic Single<ValidatedRequest> rxValidate(HttpServerRequest request)
validate(io.vertx.reactivex.core.http.HttpServerRequest)
, but the operationId and ValidatableRequest
are
determined from the passed request.
Note: Determining the operationId is expensive. If possible use validate(io.vertx.reactivex.core.http.HttpServerRequest)
.request
- the request to validatepublic Future<ValidatedRequest> validate(HttpServerRequest request, String operationId)
validate(io.vertx.reactivex.core.http.HttpServerRequest)
, but ValidatableRequest
are directly extracted from the passed request.request
- the request to validateoperationId
- the id of the related operation.public Single<ValidatedRequest> rxValidate(HttpServerRequest request, String operationId)
validate(io.vertx.reactivex.core.http.HttpServerRequest)
, but ValidatableRequest
are directly extracted from the passed request.request
- the request to validateoperationId
- the id of the related operation.public Future<ValidatedRequest> validate(ValidatableRequest params, String operationId)
params
- the request parameters to validate.operationId
- the id of the related operation.public Single<ValidatedRequest> rxValidate(ValidatableRequest params, String operationId)
params
- the request parameters to validate.operationId
- the id of the related operation.public static RequestValidator newInstance(RequestValidator arg)
Copyright © 2025 Eclipse. All rights reserved.