fix download option set error.

This commit is contained in:
shalousun 2021-11-02 17:08:54 +08:00
parent c123d83c69
commit 19506d33f0
4 changed files with 9 additions and 11 deletions

View File

@ -57,10 +57,11 @@ public class BaseDocBuilderTemplate {
* check condition and init
*
* @param config Api config
* @param checkOutPath check out path
*/
public void checkAndInit(ApiConfig config,boolean torna) {
public void checkAndInit(ApiConfig config,boolean checkOutPath) {
this.checkAndInitForGetApiData(config);
if (StringUtil.isEmpty(config.getOutPath())&&!torna) {
if (StringUtil.isEmpty(config.getOutPath())&&!checkOutPath) {
throw new RuntimeException("doc output path can't be null or empty");
}
}

View File

@ -106,9 +106,10 @@ public interface IDocBuildTemplate<T> {
/**
* handle group api docs
*
* @param apiDocList
* @param apiConfig
* @param apiDocList list of apiDocList
* @param apiConfig ApiConfig apiConfig
* @author cqmike
* @return List of ApiDoc
*/
default List<ApiDoc> handleApiGroup(List<ApiDoc> apiDocList, ApiConfig apiConfig) {
if (CollectionUtil.isEmpty(apiDocList) || apiConfig == null) {

View File

@ -342,10 +342,6 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
} else {
apiMethodDoc.setResponseUsage(JsonBuildHelper.buildReturnJson(docJavaMethod, projectBuilder));
}
// auto mark file download
if (Objects.isNull(docletTag)) {
apiMethodDoc.setDownload(docJavaMethod.isDownload());
}
// build response params
List<ApiParam> responseParams = buildReturnApiParams(docJavaMethod, projectBuilder);
if (paramsDataToTree) {

View File

@ -293,10 +293,10 @@ public class DocUtil {
/**
* // /detail/{id:[a-zA-Z0-9]{3}}/{name:[a-zA-Z0-9]{3}}
* 去除正则表达式
* remove pattern
*
* @param str
* @return
* @param str path
* @return String
*/
public static String formatPathUrl(String str) {
if (!str.contains(":")) {