Skip to content

Commit

Permalink
fix constraints not being applied to parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaktushose committed Dec 15, 2023
1 parent 4f94815 commit 234f017
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ public OptionData toOptionData(boolean isAutoComplete) {
}

constraints.stream().filter(constraint ->
constraint.getAnnotation().getClass().isAssignableFrom(Min.class)
constraint.getAnnotation() instanceof Min
).findFirst().ifPresent(constraint -> optionData.setMinValue(((Min) constraint.getAnnotation()).value()));

constraints.stream().filter(constraint ->
constraint.getAnnotation().getClass().isAssignableFrom(Max.class)
constraint.getAnnotation() instanceof Max
).findFirst().ifPresent(constraint -> optionData.setMaxValue(((Max) constraint.getAnnotation()).value()));

java.util.Optional.ofNullable(CHANNEL_TYPE_RESTRICTIONS.get(type)).ifPresent(optionData::setChannelTypes);
Expand Down

0 comments on commit 234f017

Please sign in to comment.