You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
}
When you validate a schema your result is an OutputUnit. This OutputUnit shows you why the validation failed.
Example:
#/items: Items did not match schema
#/items/$ref: A subschema had errors
#/items/$ref/oneOf: Instance does not match exactly one subschema (0 matches)
#/items/$ref/oneOf/0/$ref: A subschema had errors
#/items/$ref/oneOf/0/$ref/allOf: Instance does not match every subschema
#/items/$ref/oneOf/0/$ref/allOf/1/properties: Property "value" does not match schema
#/items/$ref/oneOf/0/$ref/allOf/1/properties/value/type: Instance type string is invalid. Expected integer
#/items/$ref/oneOf/1/$ref: A subschema had errors
#/items/$ref/oneOf/1/$ref/allOf: Instance does not match every subschema
#/items/$ref/oneOf/1/$ref/allOf/1/properties: Property "modelType" does not match schema
#/items/$ref/oneOf/1/$ref/allOf/1/properties/modelType/pattern: String does not match pattern
#/items/$ref/oneOf/2/$ref: A subschema had errors
#/items/$ref/oneOf/2/$ref/allOf: Instance does not match every subschema
#/items/$ref/oneOf/2/$ref/allOf/1/properties: Property "value" does not match schema
#/items/$ref/oneOf/2/$ref/allOf/1/properties/value/type: Instance type string is invalid. Expected array
#/items/$ref/oneOf/2/$ref/allOf/1/properties: Property "modelType" does not match schema
#/items/$ref/oneOf/2/$ref/allOf/1/properties/modelType/pattern: String does not match pattern
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:
Result:
Just olny
JsonSchema Validation error
,which field no pass?The text was updated successfully, but these errors were encountered: