Skip to content

Commit

Permalink
chore: no direct dependency on javax.validation.constraints.NotNull w…
Browse files Browse the repository at this point in the history
…hen scanning classes
  • Loading branch information
murdos authored and kbuntrock committed Oct 2, 2024
1 parent 8b7bc57 commit 70f9202
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import io.github.kbuntrock.utils.OpenApiDataType;
import io.github.kbuntrock.utils.OpenApiTypeResolver;
import io.github.kbuntrock.utils.ParameterLocation;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.lang.reflect.Type;
Expand All @@ -22,7 +23,6 @@
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.reflect.MethodUtils;
Expand Down Expand Up @@ -168,7 +168,7 @@ protected List<ParameterObject> readParameters(final Method originalMethod, fina
}
parameters.putIfAbsent(paramObj.getName(), paramObj);

final MergedAnnotation<NotNull> notnullMA = mergedAnnotations.get(NotNull.class);
final MergedAnnotation<Annotation> notnullMA = mergedAnnotations.get("javax.validation.constraints.NotNull");
// Detect if required
if(notnullMA.isPresent()) {
paramObj.setRequired(notnullMA.isPresent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.reflect.MethodUtils;
Expand Down Expand Up @@ -156,7 +155,7 @@ protected List<ParameterObject> readParameters(final Method originalMethod, fina
}
parameters.putIfAbsent(paramObj.getName(), paramObj);

final MergedAnnotation<NotNull> notnullMA = mergedAnnotations.get(NotNull.class);
final MergedAnnotation<Annotation> notnullMA = mergedAnnotations.get("javax.validation.constraints.NotNull");
// Detect if required
if(notnullMA.isPresent()) {
paramObj.setRequired(notnullMA.isPresent());
Expand Down

0 comments on commit 70f9202

Please sign in to comment.