Package io.vertx.openapi.validation
Class RequestUtils
- java.lang.Object
-
- io.vertx.openapi.validation.RequestUtils
-
public class RequestUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Future<ValidatableRequest>
extract(HttpServerRequest request, Operation operation)
Extracts and transforms the parameters and the body of an incoming request into aformat
that can be validated by theRequestValidator
.static Future<ValidatableRequest>
extract(HttpServerRequest request, Operation operation, java.util.function.Supplier<Future<Buffer>> bodySupplier)
Likeextract(HttpServerRequest, Operation)
, but offers to pass a supplier fpr the body.static int
findPathSegment(String templatePath, String parameterName)
-
-
-
Method Detail
-
extract
public static Future<ValidatableRequest> extract(HttpServerRequest request, Operation operation)
Extracts and transforms the parameters and the body of an incoming request into aformat
that can be validated by theRequestValidator
.- Parameters:
request
- the incoming request.operation
- the operation of the related request.- Returns:
- A
Future
holding the ValidatableRequest.
-
extract
public static Future<ValidatableRequest> extract(HttpServerRequest request, Operation operation, java.util.function.Supplier<Future<Buffer>> bodySupplier)
Likeextract(HttpServerRequest, Operation)
, but offers to pass a supplier fpr the body. This is helpful in case that the request has already been read.- Parameters:
request
- the incoming request.operation
- the operation of the related request.bodySupplier
- the body supplier which can help in case that the request has already been read.- Returns:
- A
Future
holding the ValidatableRequest.
-
-