|
@ -1,12 +1,5 @@
|
|
|
package com.yihu.jw.base.config;
|
|
|
|
|
|
import io.github.swagger2markup.GroupBy;
|
|
|
import io.github.swagger2markup.Language;
|
|
|
import io.github.swagger2markup.Swagger2MarkupConfig;
|
|
|
import io.github.swagger2markup.Swagger2MarkupConverter;
|
|
|
import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder;
|
|
|
import io.github.swagger2markup.markup.builder.MarkupLanguage;
|
|
|
|
|
|
import java.net.URL;
|
|
|
import java.nio.file.Path;
|
|
|
import java.nio.file.Paths;
|
|
@ -24,19 +17,19 @@ public class SwaggerDocs {
|
|
|
String prefix = Thread.currentThread().getContextClassLoader().getResource("").getPath();
|
|
|
Path outputFile = Paths.get(prefix.substring(prefix.lastIndexOf(":") + 1, prefix.indexOf("target") - 1) + "/build/" + group); //文档输出地址
|
|
|
|
|
|
Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
|
|
|
.withMarkupLanguage(MarkupLanguage.ASCIIDOC)
|
|
|
.withOutputLanguage(Language.ZH)
|
|
|
.withPathsGroupedBy(GroupBy.TAGS)
|
|
|
.withGeneratedExamples()
|
|
|
.withoutInlineSchema()
|
|
|
//.withBasePathPrefix()
|
|
|
.build();
|
|
|
|
|
|
Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(remoteSwaggerFile)
|
|
|
.withConfig(config)
|
|
|
.build();
|
|
|
|
|
|
converter.toFile(outputFile);
|
|
|
// Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
|
|
|
// .withMarkupLanguage(MarkupLanguage.ASCIIDOC)
|
|
|
// .withOutputLanguage(Language.ZH)
|
|
|
// .withPathsGroupedBy(GroupBy.TAGS)
|
|
|
// .withGeneratedExamples()
|
|
|
// .withoutInlineSchema()
|
|
|
// //.withBasePathPrefix()
|
|
|
// .build();
|
|
|
//
|
|
|
// Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(remoteSwaggerFile)
|
|
|
// .withConfig(config)
|
|
|
// .build();
|
|
|
//
|
|
|
// converter.toFile(outputFile);
|
|
|
}
|
|
|
}
|