Open
Description
The (validate)
option does nested validation of message fields. An additional feature of this option is that it can unpack the message if the field type is Any
. It tries to find a Java class for the given Any
, unpack if found, and invoke validate()
if the unpacked object implements ValidatableMessage
.
The problem is that the ConstraintViolation
instance has no place where to put the name of the unpacked type.
Currently, we fill in two fields:
typeName
- the root type that triggered validation.fieldPath
– the path to the invalid field relatively to thetypeName
.
An example of the failing validation with Any
:
io.spine.validate.ValidationException: ValidationException: At `spine.server.dispatch.InboxAddresses`:
At `id.simple_name`: The field `spine.server.dispatch.InboxAddresses.id.simple_name` of the type `string` must have a non-default value.
In this example, spine.server.dispatch.InboxAddresses.id.simple_name
is the failed field, where spine.server.dispatch.InboxAddresses.id
is Any
. So, it is not clear what type had the invalid simple_name
field.
Metadata
Metadata
Assignees
Labels
No labels