修复issue #I191EO 表单数组显示问题

This commit is contained in:
xingzi 2020-03-03 22:38:10 +08:00
parent db5c5c4a37
commit 723f7f87c0
2 changed files with 8 additions and 2 deletions

View File

@ -435,7 +435,8 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate {
}
if (JavaClassValidateUtil.isPrimitive(gicName)) {
ApiParam param = ApiParam.of().setField(paramName)
.setType(DocClassUtil.processTypeNameForParams(simpleName));
.setType(DocClassUtil.processTypeNameForParams(simpleName))
.setDesc(comment).setRequired(required).setVersion(DocGlobalConstants.DEFAULT_VERSION);
paramList.add(param);
} else {
if (requestBodyCounter > 0) {

View File

@ -412,11 +412,16 @@ public class DocUtil {
}
public static Map<String, String> formDataToMap(List<FormData> formDataList) {
Map<String, String> formDataMap = new LinkedHashMap<>();
Map<String, String> formDataMap = new IdentityHashMap<>();
for (FormData formData : formDataList) {
if ("file".equals(formData.getType())) {
continue;
}
if(formData.getKey().contains("[]")){
String key = formData.getKey().substring(0,formData.getKey().indexOf("["));
formDataMap.put(key,formData.getValue()+"&"+key+"="+formData.getValue());
continue;
}
formDataMap.put(formData.getKey(), formData.getValue());
}
return formDataMap;