public interface ResponseValidator
ResponseValidator
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 response must be stored in a ValidatableResponse
object. For these examples the key
of those values is always color.
These are the initial values for each type: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 | +--------+---------+-------+-----------+------------------------------------+-------------------------+
Modifier and Type | Method and Description |
---|---|
static ResponseValidator |
create(Vertx vertx,
OpenAPIContract contract)
Create a new
ResponseValidator . |
Future<ValidatedResponse> |
validate(ValidatableResponse params,
String operationId)
Validates the passed response parameters against the operation defined in the related OpenAPI contract.
|
static ResponseValidator create(Vertx vertx, OpenAPIContract contract)
ResponseValidator
.vertx
- the related Vert.x instancecontract
- the related OpenAPIContract
ResponseValidator
.Future<ValidatedResponse> validate(ValidatableResponse params, String operationId)
params
- the response parameters to validate.operationId
- the id of the related operation.Copyright © 2023 Eclipse. All rights reserved.