fix:gitee I3W9DY
This commit is contained in:
parent
5a147bac10
commit
7064028106
|
@ -66,6 +66,19 @@ public class ApiReqHeader {
|
|||
*/
|
||||
private String since = "-";
|
||||
|
||||
/**
|
||||
* ignore request header
|
||||
*/
|
||||
private String regex;
|
||||
|
||||
public String getRegex() {
|
||||
return regex;
|
||||
}
|
||||
|
||||
public void setRegex(String regex) {
|
||||
this.regex = regex;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static ApiReqHeader header() {
|
||||
return new ApiReqHeader();
|
||||
|
@ -157,6 +170,8 @@ public class ApiReqHeader {
|
|||
.append(required);
|
||||
sb.append(",\"since\":\"")
|
||||
.append(since).append('\"');
|
||||
sb.append(",\"regex\":\"")
|
||||
.append(regex).append('\"');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
@ -227,6 +227,12 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
|
|||
}
|
||||
//reduce create in template
|
||||
apiMethodDoc.setHeaders(this.createDocRenderHeaders(allApiReqHeaders, apiConfig.isAdoc()));
|
||||
allApiReqHeaders.removeIf(apiReqHeader -> {
|
||||
if (StringUtil.isNotEmpty(apiReqHeader.getRegex())) {
|
||||
return requestMapping.getShortUrl().matches(apiReqHeader.getRegex());
|
||||
}
|
||||
return false;
|
||||
});
|
||||
apiMethodDoc.setRequestHeaders(allApiReqHeaders);
|
||||
|
||||
// build request json
|
||||
|
|
Loading…
Reference in New Issue