I am using vertx 4.4.4 and tried to use the following code snippet
SchemaParser parser = SchemaParser.createDraft7SchemaParser(
SchemaRouter.create(vertx, new SchemaRouterOptions()));
I get a deprecation warning for SchemaParser, SchemaRouter, SchemaRouterOptions
I tried to read through the docs to find what is the suggested approach but could not find it.
I later use the parser in the following code
router.post("/demo")
.handler(new BodyHandlerImpl())
.handler(ValidationHandlerBuilder.create(parser)
.body(Bodies.json(objectSchemaBuilder))
.body(Bodies.formUrlEncoded(objectSchemaBuilder))
.build())
.handler(this::greet);
SchemaParseris deprecated in favor ofSchemaRepository.First, create the repository:
Then use it in the
ValidationHandlerBuilder: