I have below schema definition to represent commission amount
in my openapi contract.
commissionAmount:
type: number
minimum: -99999.99
maximum: 99999.99
Generated Code:
@Valid
@DecimalMin("-99999.99") @DecimalMax("99999.99")
public BigDecimal getCommissionAmount() {
return commAmt;
}
The generated code is good and as expected. I just wanted to know are these -99999.99
and 99999.99
valid values for minimum
and maximum
.
The reason for asking this question is it does not check the limit in the fractional part. For example, I expect 12345.678
is invalid , 12345.67
is valid. But it marks both as valid.
I read @Digits
is used to check for the digit limit of integer and fractional part. How do I tell openapi-generator-maven-plugin
to annotate Digits
as well?
Expected Generated Code:
@Valid
@Digits(integer = 5, fraction = 2)
@DecimalMin("-99999.99") @DecimalMax("99999.99")
public BigDecimal getCommissionAmount() {
return commAmt;
}