-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Labels
BugSomething isn't workingSomething isn't working
Description
Description
After upgrading to 0.6.0 and newer, we no longer get the field name in the log messages.
The issue is the change from
if (!violation.toProto().getFieldPath().isEmpty()) {
builder.append(violation.toProto().getFieldPath());
builder.append(": ");
}
to
if (!violation.toProto().hasField()) {
builder.append(FieldPathUtils.fieldPathString(violation.toProto().getField()));
builder.append(": ");
}
The fieldName should be written when hasField() is true, and not when it's false.
Steps to Reproduce
Execute any API call with a validation error. Message will look like this
value is empty, which is not a valid UUID [string.uuid_empty]
Expected Behavior
The error should show the fieldName as in version 0.5.0
fieldName: value is empty, which is not a valid UUID [string.uuid_empty]
Actual Behavior
Screenshots/Logs
Environment
- Operating System: mXOA
- Version: 14
- Compiler/Toolchain: KOTLIN-1.9
- Protobuf Compiler & Version: 4.30.2
- Protovalidate Version: 0.7.2
Possible Solution
Change the condition to
if (violation.toProto().hasField()) {
builder.append(FieldPathUtils.fieldPathString(violation.toProto().getField()));
builder.append(": ");
}
Additional Context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't working