Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.

Commit 82adc32

Browse files
authored
Merge pull request #1080 from shalousun/master
fix: Fix the error in document generation when the response field use…
2 parents cec23db + 1593df5 commit 82adc32

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/main/java/com/ly/doc/helper/JsonBuildHelper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,6 @@ else if (JavaClassValidateUtil.isReactor(typeName)) {
287287

288288
// get tags value from the field
289289
Map<String, String> tagsMap = DocUtil.getFieldTagsValue(field, docField);
290-
// get annotations on the field
291-
List<JavaAnnotation> annotations = docField.getAnnotations();
292290

293291
// field json annotation
294292
FieldJsonAnnotationInfo annotationInfo = getFieldJsonAnnotationInfo(projectBuilder, docField, isResp,
@@ -301,7 +299,7 @@ else if (JavaClassValidateUtil.isReactor(typeName)) {
301299
String fieldJsonFormatValue = annotationInfo.getFieldJsonFormatValue();
302300
// has Annotation @JsonSerialize And using ToStringSerializer
303301
boolean toStringSerializer = Boolean.TRUE.equals(annotationInfo.getToStringSerializer());
304-
if (Objects.nonNull(annotationInfo.getFieldName())) {
302+
if (StringUtil.isNotEmpty(annotationInfo.getFieldName())) {
305303
fieldName = annotationInfo.getFieldName();
306304
}
307305

src/main/java/com/ly/doc/helper/ParamsBuildHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ private static List<ApiParam> processFields(String className, String pre, int le
290290
String fieldJsonFormatValue = annotationInfo.getFieldJsonFormatValue();
291291
// has Annotation @JsonSerialize And using ToStringSerializer
292292
boolean toStringSerializer = Boolean.TRUE.equals(annotationInfo.getToStringSerializer());
293-
if (Objects.nonNull(annotationInfo.getFieldName())) {
293+
if (StringUtil.isNotEmpty(annotationInfo.getFieldName())) {
294294
fieldName = annotationInfo.getFieldName();
295295
}
296296
if (Objects.nonNull(annotationInfo.getStrRequired())) {

0 commit comments

Comments
 (0)