修改postman数据头部默认值问题

This commit is contained in:
xingzi 2020-04-20 15:46:56 +08:00
parent e7e17d6771
commit 817cc4bfd6
3 changed files with 15 additions and 0 deletions

View File

@ -163,6 +163,7 @@ public class PostmanJsonBuilder {
HeaderBean headerBean = new HeaderBean();
headerBean.setKey(apiReqHeader.getName());
headerBean.setName(apiReqHeader.getName());
headerBean.setValue(apiReqHeader.getValue());
headerBean.setDisabled(!apiReqHeader.isRequired());
headerBean.setDescription(apiReqHeader.getDesc());
headerBeans.add(headerBean);

View File

@ -71,6 +71,7 @@ public class SpringMVCRequestHeaderHandler {
desc.append(comments);
if (requestHeaderMap.get(DocAnnotationConstants.DEFAULT_VALUE_PROP) != null) {
apiReqHeader.setValue(StringUtil.removeQuotes((String) requestHeaderMap.get(DocAnnotationConstants.DEFAULT_VALUE_PROP)));
desc.append("(defaultValue: ")
.append(StringUtil.removeQuotes((String) requestHeaderMap.get(DocAnnotationConstants.DEFAULT_VALUE_PROP)))
.append(")");

View File

@ -41,6 +41,10 @@ public class ApiReqHeader {
* Request header type
*/
private String type;
/**
* request header defaultValue
*/
private String value;
/**
* Request header description
*/
@ -109,6 +113,15 @@ public class ApiReqHeader {
return this;
}
public String getValue() {
return value;
}
public ApiReqHeader setValue(String value) {
this.value = value;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;