Optimize the generic parameter type, when the generic parameter is the basic type, the type is displayed as the basic type .
This commit is contained in:
parent
d9a630658d
commit
91b6b87244
|
@ -415,7 +415,7 @@ public class JsonBuildHelper {
|
|||
data0.append(buildJson(simple, gicName, isResp, nextLevel, registryClasses, groupClasses, builder)).append(",");
|
||||
}
|
||||
} else {
|
||||
data0.append("{\"waring\":\"You may have used non-display generics.\"},");
|
||||
data0.append("{},");
|
||||
}
|
||||
} else if (DocGlobalConstants.JAVA_OBJECT_FULLY.equals(subTypeName)) {
|
||||
if (StringUtil.isNotEmpty(field.getComment())) {
|
||||
|
@ -431,10 +431,10 @@ public class JsonBuildHelper {
|
|||
data0.append(buildJson(simpleName, gicName, isResp, nextLevel, registryClasses, groupClasses, builder)).append(",");
|
||||
}
|
||||
} else {
|
||||
data0.append("{\"waring\":\"You may have used non-display generics.\"},");
|
||||
data0.append("{},");
|
||||
}
|
||||
} else {
|
||||
data0.append("{\"waring\":\"You may have used non-display generics.\"},");
|
||||
data0.append("{},");
|
||||
}
|
||||
} else if (typeName.equals(subTypeName)) {
|
||||
data0.append("{\"$ref\":\"...\"}").append(",");
|
||||
|
|
|
@ -331,7 +331,19 @@ public class ParamsBuildHelper {
|
|||
|
||||
String processedType;
|
||||
if (typeSimpleName.length() == 1) {
|
||||
processedType = DocClassUtil.processTypeNameForParams(typeSimpleName.toLowerCase());
|
||||
String gicName = JAVA_OBJECT_FULLY;
|
||||
if (Objects.nonNull(genericMap.get(typeSimpleName))) {
|
||||
gicName = genericMap.get(subTypeName);
|
||||
} else {
|
||||
if (globGicName.length > 0) {
|
||||
gicName = globGicName[0];
|
||||
}
|
||||
}
|
||||
if (JavaClassValidateUtil.isPrimitive(gicName)) {
|
||||
processedType = DocClassUtil.processTypeNameForParams(gicName);
|
||||
} else {
|
||||
processedType = DocClassUtil.processTypeNameForParams(typeSimpleName.toLowerCase());
|
||||
}
|
||||
} else {
|
||||
processedType = isShowJavaType ? typeSimpleName : DocClassUtil.processTypeNameForParams(typeSimpleName.toLowerCase());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue