Hi,
When I have a decimal restriction on a simpletype, then the generated @digits annotation is wrong.
test.xsd.txt
pom.xml.txt
(source files are attached).
Problematic part of xsd:
<xs:simpleType name="Amount_SimpleType">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0"/>
<xs:fractionDigits value="17"/>
<xs:totalDigits value="18"/>
</xs:restriction>
</xs:simpleType>
Generated java code:
@DecimalMin("0")
@digits(integer = 1, fraction = 17)
In xsd standard fractionDigits means MAXIMUM number of fraction digits, and totalDigits means MAXIMUM number of total digits.
In jsr303, it means MAXIMUM number of INTEGER digits and fraction digits. It describes the numbers differently.
I advise to put the value of totalDigits into the integer field. It's not the perfect solution but jsr doesn't let us define the totalDigits correctly.