Skip to content

Commit

Permalink
feat(autodoc): use description annotation field and value as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Jan 17, 2025
1 parent 4bdefc0 commit 49634d2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Stream;
import javax.lang.model.element.Element;
import javax.lang.model.element.VariableElement;
Expand Down Expand Up @@ -153,7 +154,8 @@ private ConfigurationSetting createConfigurationSetting(VariableElement settingE

return ConfigurationSetting.Builder.newInstance()
.key(keyValue)
.description(attributeValue(String.class, "value", settingMirror, elementUtils))
.description(Optional.ofNullable(attributeValue(String.class, "description", settingMirror, elementUtils))
.orElseGet(() -> attributeValue(String.class, "value", settingMirror, elementUtils)))
.type(attributeValue(String.class, "type", settingMirror, elementUtils))
.required(attributeValue(Boolean.class, "required", settingMirror, elementUtils))
.maximum(attributeValue(Long.class, "max", settingMirror, elementUtils))
Expand Down

0 comments on commit 49634d2

Please sign in to comment.