Repository navigation
GH-2531 - Map @Size on CharSequence to minLength/maxLength - #2537
Closed
kalayciburak wants to merge 1 commit into
Closed
kalayciburak wants to merge 1 commit into
kalayciburak wants to merge 1 commit into
Conversation
odrotbohm
force-pushed
the
main
branch
3 times, most recently
from
August 21, 2026 12:18
419490b to
04aac86
Compare
…ngth For CharSequence properties, jakarta.validation @SiZe constrains character count. Surface that as HAL-FORMS minLength/maxLength and keep the default text input type instead of forcing type=range with numeric min/max. Non-CharSequence @SiZe usage is unchanged. Signed-off-by: Burak KALAYCI <kalayciburak1996@gmail.com>
kalayciburak
force-pushed
the
fix/hal-forms-size-charsequence-minlength
branch
from
October 16, 2026 05:33
2fdca21 to
3c933c3
Compare
Member
|
I've applied this and extended on it. Most important: skip the attribute rendering for default values and flip to the more appropriate attributes for collections, maps, and arrays. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #2531.
jakarta.validation.constraints.Sizeconstrains character/element count, not a numeric value range. ForCharSequenceproperties this change:@Sizebounds to HAL-FORMSminLength/maxLengthtype: "range"so the default text input is usedmin/maxunset for those propertiesNon-
CharSequence@Sizeusage (and existing tests using@Sizeon non-text properties) keep the previousrange+min/maxbehavior. Hibernate Validator@Lengthcontinues to contribute length bounds as before.Test plan
./mvnw -Dtest=PropertyUtilsTest test(22 tests, GREEN; Java 17)