vertx-json-schema icon indicating copy to clipboard operation
vertx-json-schema copied to clipboard

The throw statement throws an exception, displaying errors for fields that do not meet the specified validation rules.

Open difflib opened this issue 2 years ago • 0 comments

Describe the feature

When application throws a JsonSchemaValidationException exception,no message for more detail. I would like to throw validation error so that the modal will show the form field that has the error.

Use cases

Source:

val repository = SchemaRepository.create(JsonSchemaOptions().setDraft(Draft.DRAFT202012).setBaseUri("app://"))
repository.dereference("test.json", JsonSchema.of(jsonObject))            
val validator=repository.validator("test.json").validate(json).checkValidity()
} catch (th: Throwable) {
      th.printStackTrace()
}

Result:

15:11:05.984 DEBUG [vert.x-eventloop-thread-1] io.netty.handler.logging.LoggingHandler [id: 0x2a560fc3, L:/127.0.0.1:9091 - R:/127.0.0.1:4136] READ COMPLETE
io.vertx.json.schema.JsonSchemaValidationException: JsonSchema Validation error

Just olny JsonSchema Validation error,which field no pass?

difflib avatar Nov 30 '23 07:11 difflib