fix: fix for annotation does not work properly on List
@@ -21,13 +21,7 @@ package springfox.documentation.swagger2.mappers;
import io.swagger.models.ModelImpl;
import io.swagger.models.parameters.SerializableParameter;
-import io.swagger.models.properties.AbstractNumericProperty;
-import io.swagger.models.properties.DoubleProperty;
-import io.swagger.models.properties.FloatProperty;
-import io.swagger.models.properties.IntegerProperty;
-import io.swagger.models.properties.LongProperty;
-import io.swagger.models.properties.Property;
-import io.swagger.models.properties.StringProperty;
+import io.swagger.models.properties.*;
import springfox.documentation.service.AllowableListValues;
import springfox.documentation.service.AllowableRangeValues;
import springfox.documentation.service.AllowableValues;
@@ -130,6 +124,12 @@ public class EnumMapper {
numeric.setMinimum(safeBigDecimal(range.getMin()));
numeric.exclusiveMinimum(range.getExclusiveMin());
}
+ if (property instanceof ArrayProperty) {
+ ArrayProperty arrayProperty = (ArrayProperty) property;
+ AllowableRangeValues allowableRangeValues = (AllowableRangeValues) allowableValues;
+ arrayProperty.setMinItems(safeInteger(allowableRangeValues.getMin()));
+ arrayProperty.setMaxItems(safeInteger(allowableRangeValues.getMax()));
+ }
}
return property;
}
