Add test ACustomerMessageTest (shows Size min not defaulting) #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Size min expected to default to 0 according to the error messages we have.
So given:
Generates:
And we can get the validation message where the {min} is not replaced (with say 0 or indeed 1):
The default value for Size min is 0, so we reasonably expect the
{min}
to be replaced by0
.I note that we know in this case that there is also the
@NotBlank
and technically that means that the Size min should really be 1 (because we know with the NotBlank that 0 isn't a valid minimum number of chars).Perhaps ... we could ensure the ordering such that
NotBlank, NotEmpty, NotNull
are higher precedence and the generated code always puts those first and IF that happened and the context knew that a NotBlank proceeded the Size THEN ... it could deduce that the default min should be 1.Regardless it looks like the way SizeAdapter is created needs adjustment to allow for the min defaulting to 0.