Micronaut-core: Add default validation message for `@DecimalM(in|ax)`

Created on 18 Jun 2020  路  2Comments  路  Source: micronaut-projects/micronaut-core

Micronaut's default constraint validator does not benefit from validation messages for the @DecimalMin and @DecimalMax annotations in the [DefaultValidationMessages] class (https://github.com/micronaut-projects/micronaut-core/blob/d4234cb76b3e35dddb4b6ba89e99463d40863795/validation/src/main/java/io/micronaut/validation/validator/messages/DefaultValidationMessages.java#L44), contrarily to @Min and @Max.

Steps to Reproduce

  1. Violate a @DecimalMin (or @DecimalMax) constraint

Expected Behaviour

The received validation message should be something like must be greater than or equal to {value} (resp. must be less than or equal to {value}) - close to what is defined for @Min (resp. @Max).

Actual Behaviour

The received validation message is javax.validation.constraints.DecimalMin.message (resp. javax.validation.constraints.DecimalMax.message).

Environment Information

  • Micronaut Version: 2.0.0-RC1
help wanted good first issue improvement

All 2 comments

Seems like a great area to contribute a PR

@graemerocher I will later today

Was this page helpful?
0 / 5 - 0 ratings