@Negative*/@Positive* do not support CharSequence as documented

Description

The hibernate validator documentation for @Negative, @NegativeOrZero, @Positive, and @PositiveOrZero states that hibernate validator supports validating any subtype of CharSequence:

additionally supported by HV: any sub-type of CharSequence (the numeric value represented by the character sequence is evaluated)

However, when attempting to validate a String field with any of those constraints, hibernate validator throws the following exception:

Here is a unit test that demonstrates the problem:

Please either update the documentation, or add support for CharSequences to these constraints.

Environment

None

Activity

Show:
Guillaume Smet
March 9, 2020, 10:10 PM

You're right, the validators are missing.

Did you have any use for them? Maybe you would be interested in contributing? It shouldn't be too hard to add them if you need them.

PhilC
March 9, 2020, 11:35 PM

I have no immediate need for them. Simply updating the documentation would be fine with me.

Assignee

Guillaume Smet

Reporter

PhilC

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Minor
Configure