Skip to content

Commit

Permalink
Set correct group description
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Lovakov authored and jmartisk committed Sep 2, 2024
1 parent 7865320 commit aa4df31
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,23 @@ private static Optional<String> getName(AnnotationInstance graphQLApiAnnotation)
/**
* Get the description on a class type
*
* @param annotations annotation on the class
* @param graphQLApiAnnotation annotation on the class
* @return the optional description
*/
private static Optional<String> getDescription(AnnotationInstance graphQLApiAnnotation) {
ClassInfo apiClass = graphQLApiAnnotation.target().asClass();
if (apiClass.annotationsMap().containsKey(Annotations.DESCRIPTION)) {
List<AnnotationInstance> descriptionAnnotations = apiClass.annotationsMap().get(Annotations.DESCRIPTION);
if (descriptionAnnotations != null && !descriptionAnnotations.isEmpty()) {
AnnotationValue value = descriptionAnnotations.get(0).value();
if (value != null && value.asString() != null && !value.asString().isEmpty()) {
return Optional.of(value.asString());
for (AnnotationInstance descriptionAnnotation : descriptionAnnotations) {
if (descriptionAnnotation.target().equals(graphQLApiAnnotation.target())){
AnnotationValue value = descriptionAnnotation.value();
if (value != null && value.asString() != null && !value.asString().isEmpty()) {
return Optional.of(value.asString());
}
}
}
}

}
return Optional.empty();
}
Expand Down

0 comments on commit aa4df31

Please sign in to comment.