@@ -1495,20 +1495,20 @@ protected void applyBeanValidatorAnnotations(Schema property, Annotation[] annot
1495
1495
}
1496
1496
}
1497
1497
if (annos .containsKey ("javax.validation.constraints.Min" )) {
1498
- if ("integer" . equals (property . getType ()) || "number" . equals ( property . getType () )) {
1498
+ if (isNumberSchema (property )) {
1499
1499
Min min = (Min ) annos .get ("javax.validation.constraints.Min" );
1500
1500
property .setMinimum (new BigDecimal (min .value ()));
1501
1501
}
1502
1502
}
1503
1503
if (annos .containsKey ("javax.validation.constraints.Max" )) {
1504
- if ("integer" . equals (property . getType ()) || "number" . equals ( property . getType () )) {
1504
+ if (isNumberSchema (property )) {
1505
1505
Max max = (Max ) annos .get ("javax.validation.constraints.Max" );
1506
1506
property .setMaximum (new BigDecimal (max .value ()));
1507
1507
}
1508
1508
}
1509
1509
if (annos .containsKey ("javax.validation.constraints.Size" )) {
1510
1510
Size size = (Size ) annos .get ("javax.validation.constraints.Size" );
1511
- if ("integer" . equals (property . getType ()) || "number" . equals ( property . getType () )) {
1511
+ if (isNumberSchema (property )) {
1512
1512
property .setMinimum (new BigDecimal (size .min ()));
1513
1513
property .setMaximum (new BigDecimal (size .max ()));
1514
1514
}
@@ -3013,7 +3013,7 @@ protected boolean isStringSchema(Schema schema){
3013
3013
}
3014
3014
3015
3015
protected boolean isNumberSchema (Schema schema ){
3016
- return "number" .equals (schema .getType ()) || (schema .getTypes () != null && schema .getTypes ().contains ("number" ));
3016
+ return "number" .equals (schema .getType ()) || (schema .getTypes () != null && schema .getTypes ().contains ("number" )) || "integer" . equals ( schema . getType ()) || ( schema . getTypes () != null && schema . getTypes (). contains ( "integer" )) ;
3017
3017
}
3018
3018
3019
3019
protected Schema buildRefSchemaIfObject (Schema schema , ModelConverterContext context ) {
0 commit comments