diff --git a/src/main/java/com/ly/doc/helper/JsonBuildHelper.java b/src/main/java/com/ly/doc/helper/JsonBuildHelper.java index 26cfe061..657afa61 100644 --- a/src/main/java/com/ly/doc/helper/JsonBuildHelper.java +++ b/src/main/java/com/ly/doc/helper/JsonBuildHelper.java @@ -303,6 +303,7 @@ public static String buildJson(String typeName, String genericCanonicalName, fieldName = StringUtil.isEmpty(customResponseField.getReplaceName()) ? fieldName : customResponseField.getReplaceName(); } } + fieldName = fieldName.trim(); data0.append("\"").append(fieldName).append("\":"); String fieldValue = getFieldValueFromMock(subTypeName, tagsMap, typeSimpleName); if (JavaClassValidateUtil.isPrimitive(subTypeName)) { diff --git a/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java b/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java index 3f95a091..50eb4b86 100644 --- a/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java +++ b/src/main/java/com/ly/doc/helper/ParamsBuildHelper.java @@ -284,6 +284,7 @@ public static List buildParams(String className, String pre, int level && JavaClassUtil.isTargetChildClass(simpleName, customResponseField.getOwnerClassName()) && isResp) { fieldName = customResponseField.getReplaceName(); } + fieldName = fieldName.trim(); // Analyzing File Type Field if (JavaClassValidateUtil.isFile(fieldGicName)) { ApiParam param = ApiParam.of().setField(pre + fieldName).setType("file")