we're setting up our HTTP endpoint with vert.x using RouterBuilder with an existing openApi specification. As for data deserialization avro-json is used (openapi is generated from avro schema) no validation of the JSON payload data should be applied by vert.x as the correct interpretation and validation should only be done during avro deserialization.
I've found https://vertx.io/docs/vertx-web-validation/java/#_without_vert_x_web_validation this but didn't work and not sure if this also appies for RouterBuilder functionality.
https://vertx.io/docs/vertx-web-openapi/java/#_routerbuilder seems to be more suitable:
Vert.x OpenAPI mounts the correct ValidationHandler for you, so you can access to request parameters and request body. Refer to Vert.x Web Validation documentation to learn how to get request parameters & request body and how to manage validation failures
But also doesn't work for me - probably applied wrongly
Any ideas how I can disable the json validation? It's a POST call
RouterBuilder.create(vertx, pathToMyOpenApi)
.onSuccess(routerBuilder -> {
routerBuilder
.operation("operation")
.handler(this::operationHandler);
SchemaRouter schemaRouter = SchemaRouter.create(this.vertx, new SchemaRouterOptions());
var dummy = MyDummyValidator.create(schemaRouter);
var router = routerBuilder.createRouter();
router.get().handler(
ValidationHandler.builder(dummy).build()
);
var subRouter = apiRouter.mountSubRouter("/path", router);
});
Thanks in advance