Description
An ID field of an entity state is assumed to be (required)
. We don't have to declare such a field with the option explicitly.
An ID could be of int32
or other type which could not have the (required)
option because of the nature of the type. If this is such a case, we should not emit the warning to console, but we do. Here's what the build of core-java
produces:
`CommandRouting` should > apply custom route() STANDARD_ERROR
Nov 25, 2024 7:09:00 PM io.spine.validate.option.Required checkUsage
WARNING: The field `spine.test.route.RegisterUser.id` has the type UINT64 and should not be declared as `(required)`.
This happens because the stub entity state used in the CommandRoutingRejectionTest
is declared like this:
message NumberStats {
option (entity).kind = VIEW;
int32 number = 1;
int32 count = 2;
}
Validation should not cause console warnings for IDs being of primitive types.
The issue with the warning text
Another aspect of this issue is the test of the warning message. Now it says:
The field `spine.test.route.RegisterUser.id` has the type UINT64 and should not be declared as `(required)`.
The text is misleading. The entity state does not have the (required
option. The field is assumed to be required because it's the convention for entity states that we have. The text of the warning should be updated in the scope of addressing the issue.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status