Fix Postman FormData description

This commit is contained in:
oppofind 2020-11-18 13:16:13 +08:00
parent 61d25f8e9a
commit 79c206a40d
4 changed files with 329 additions and 329 deletions

View File

@ -130,7 +130,7 @@ public class FormDataBuildHelper {
FormData formData = new FormData(); FormData formData = new FormData();
formData.setKey(pre + fieldName); formData.setKey(pre + fieldName);
formData.setType("file"); formData.setType("file");
formData.setDesc(comment); formData.setDescription(comment);
formData.setValue(""); formData.setValue("");
formDataList.add(formData); formDataList.add(formData);
} else if (JavaClassValidateUtil.isPrimitive(subTypeName)) { } else if (JavaClassValidateUtil.isPrimitive(subTypeName)) {
@ -144,7 +144,7 @@ public class FormDataBuildHelper {
formData.setKey(pre + fieldName); formData.setKey(pre + fieldName);
formData.setType("text"); formData.setType("text");
formData.setValue(StringUtil.removeQuotes(fieldValue)); formData.setValue(StringUtil.removeQuotes(fieldValue));
formData.setDesc(comment); formData.setDescription(comment);
formDataList.add(formData); formDataList.add(formData);
} else if (javaClass.isEnum()) { } else if (javaClass.isEnum()) {
Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.TRUE); Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.TRUE);
@ -152,7 +152,7 @@ public class FormDataBuildHelper {
formData.setKey(pre + fieldName); formData.setKey(pre + fieldName);
formData.setType("text"); formData.setType("text");
formData.setValue(StringUtil.removeQuotes(String.valueOf(value))); formData.setValue(StringUtil.removeQuotes(String.valueOf(value)));
formData.setDesc(comment); formData.setDescription(comment);
formDataList.add(formData); formDataList.add(formData);
} else if (JavaClassValidateUtil.isCollection(subTypeName)) { } else if (JavaClassValidateUtil.isCollection(subTypeName)) {
String gNameTemp = field.getType().getGenericCanonicalName(); String gNameTemp = field.getType().getGenericCanonicalName();

View File

@ -28,7 +28,7 @@ package com.power.doc.model;
public class FormData { public class FormData {
private String key; private String key;
private String type; private String type;
private String desc; private String description;
private String src; private String src;
private String value; private String value;
@ -64,12 +64,12 @@ public class FormData {
this.value = value; this.value = value;
} }
public String getDesc() { public String getDescription() {
return desc; return description;
} }
public void setDesc(String desc) { public void setDescription(String description) {
this.desc = desc; this.description = description;
} }
@Override @Override
@ -77,7 +77,7 @@ public class FormData {
return "FormData{" + return "FormData{" +
"key='" + key + '\'' + "key='" + key + '\'' +
", type='" + type + '\'' + ", type='" + type + '\'' +
", desc='" + desc + '\'' + ", description='" + description + '\'' +
", src='" + src + '\'' + ", src='" + src + '\'' +
", value='" + value + '\'' + ", value='" + value + '\'' +
'}'; '}';

View File

@ -42,6 +42,6 @@ public class InfoBean {
} else { } else {
this.name = name; this.name = name;
} }
this.schema = "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"; this.schema = "https://schema.getpostman.com/json/collection/v2.1.0/collection.json";
} }
} }

View File

@ -351,13 +351,13 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
FormData formData = new FormData(); FormData formData = new FormData();
formData.setKey(paramName); formData.setKey(paramName);
formData.setType("file"); formData.setType("file");
formData.setDesc(comment); formData.setDescription(comment);
formData.setValue(mockValue); formData.setValue(mockValue);
formDataList.add(formData); formDataList.add(formData);
} else if (JavaClassValidateUtil.isPrimitive(typeName)) { } else if (JavaClassValidateUtil.isPrimitive(typeName)) {
FormData formData = new FormData(); FormData formData = new FormData();
formData.setKey(paramName); formData.setKey(paramName);
formData.setDesc(comment); formData.setDescription(comment);
formData.setType("text"); formData.setType("text");
formData.setValue(mockValue); formData.setValue(mockValue);
formDataList.add(formData); formDataList.add(formData);
@ -375,7 +375,7 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
if (!paramName.contains("[]")) { if (!paramName.contains("[]")) {
formData.setKey(paramName + "[]"); formData.setKey(paramName + "[]");
} }
formData.setDesc(comment); formData.setDescription(comment);
formData.setType("text"); formData.setType("text");
formData.setValue(RandomUtil.randomValueByType(gicName)); formData.setValue(RandomUtil.randomValueByType(gicName));
formDataList.add(formData); formDataList.add(formData);
@ -386,7 +386,7 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
FormData formData = new FormData(); FormData formData = new FormData();
formData.setKey(paramName); formData.setKey(paramName);
formData.setType("text"); formData.setType("text");
formData.setDesc(comment); formData.setDescription(comment);
formData.setValue(strVal); formData.setValue(strVal);
formDataList.add(formData); formDataList.add(formData);
} else { } else {