-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Milestone
Description
Currently there is no support for the @Digits
annotation (https://javaee.github.io/javaee-spec/javadocs/javax/validation/constraints/Digits.html), which is part of the JSR-303 standard (example here: https://beanvalidation.org/1.0/spec/#validationapi-message-examples).
It would be good to be able to validate BigDecimal values, which is a common requirement for financial services applications.
I'd propose having a digits
field that is associated with a property, which in turn would require integerDigits
and fractionalDigits
to be set within that digits
field.
For example (this assumes that the config option of isUseBigDecimals()
returns true).
{
"type" : "object",
"properties" : {
"decimal" : {
"type" : "number",
"digits" : {
"integerDigits": 5,
"fractionalDigits": 10
}
}
}
}
Metadata
Metadata
Assignees
Labels
No labels