本文整理汇总了Java中io.github.robwin.markup.builder.MarkupLanguage类的典型用法代码示例。如果您正苦于以下问题:Java MarkupLanguage类的具体用法?Java MarkupLanguage怎么用?Java MarkupLanguage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MarkupLanguage类属于io.github.robwin.markup.builder包,在下文中一共展示了MarkupLanguage类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertSwaggerToAsciiDoc
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
@Test
public void convertSwaggerToAsciiDoc() throws Exception {
assertThat(dockets, is(notNullValue()));
assertThat(dockets, hasSize(greaterThan(0)));
dockets.stream()
.map(Docket::getGroupName)
.forEach(groupName -> {
String urlTemplate = String.format("/v2/api-docs?group=%s", groupName);
String outputDirectory = String.format("build/docs/swagger/generated/%s", groupName);
try {
this.mockMvc.perform(get(urlTemplate).accept(MediaType.APPLICATION_JSON))
.andDo(print())
.andDo(Swagger2MarkupResultHandler.outputDirectory(outputDirectory)
.withMarkupLanguage(MarkupLanguage.ASCIIDOC)
.build())
.andExpect(status().isOk());
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
示例2: convertRemoteSwaggerToMarkdown
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
@Test
public void convertRemoteSwaggerToMarkdown() throws IOException {
Swagger2MarkupConverter.from("http://localhost:8080/v2/api-docs")
.withMarkupLanguage(MarkupLanguage.MARKDOWN).build()
.intoFolder("src/docs/markdown/generated");
// Then validate that three Markdown files have been created
String[] files = new File("src/docs/markdown/generated").list();
System.out.println(files.length);
}
示例3: convertSwaggerToMarkdown
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
@Test
public void convertSwaggerToMarkdown() throws Exception {
this.mockMvc.perform(get("/v2/api-docs")
.accept(MediaType.APPLICATION_JSON))
.andDo(Swagger2MarkupResultHandler.outputDirectory("src/docs/markdown/generated")
.withMarkupLanguage(MarkupLanguage.MARKDOWN).build())
.andExpect(status().isOk());
}
示例4: convertSwaggerToMarkdown
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
@Test
public void convertSwaggerToMarkdown() throws Exception {
this.mockMvc.perform(get("/v2/api-docs?group=customer")
.accept(MediaType.APPLICATION_JSON).characterEncoding("utf-8"))
.andDo(Swagger2MarkupResultHandlerUtf8.outputDirectory("src/docs/markdown/generated")
.withMarkupLanguage(MarkupLanguage.MARKDOWN).build())
.andExpect(status().isOk());
}
示例5: convertSwaggerToMarkdown
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
@Test
public void convertSwaggerToMarkdown() throws Exception {
this.mockMvc.perform(get("/v2/api-docs?group=customer")
.accept(MediaType.APPLICATION_JSON).characterEncoding("utf-8"))
.andDo(Swagger2MarkupResultHandlerUtf8.outputDirectory("target/docs/markdown/generated")
.withMarkupLanguage(MarkupLanguage.MARKDOWN).build())
.andExpect(status().isOk());
}
示例6: convertSwaggerToMarkdown
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
@Test
public void convertSwaggerToMarkdown() throws Exception {
this.mockMvc.perform(get("/v2/api-docs")
.accept(MediaType.APPLICATION_JSON))
.andDo(Swagger2MarkupResultHandler.outputDirectory("target/docs/markdown/generated")
.withMarkupLanguage(MarkupLanguage.MARKDOWN).build())
.andExpect(status().isOk());
}
示例7: convertRemoteSwaggerToMarkdown
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
@Test
@Ignore public void convertRemoteSwaggerToMarkdown() throws IOException {
// Remote Swagger source
// Markdown
Swagger2MarkupConverter.from("http://localhost:4024/api-docs").withMarkupLanguage(MarkupLanguage.MARKDOWN).build().intoFolder("src/docs/markdown/generated");
// Then validate that three Markdown files have been created
String[] files = new File("src/docs/markdown/generated").list();
assertTrue(Arrays.asList(files).contains("definitions.md"));
assertTrue(Arrays.asList(files).contains("overview.md"));
assertTrue(Arrays.asList(files).contains("paths.md"));
}
示例8: convertSwaggerToMarkdown
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
public static void convertSwaggerToMarkdown(final String swaggerJsonUrlString,
final String targetFolderPath)
throws IOException {
Swagger2MarkupConverter.from(swaggerJsonUrlString)
.withMarkupLanguage(MarkupLanguage.MARKDOWN)
.withPathsGroupedBy(GroupBy.TAGS)
.withDefinitionsOrderedBy(OrderBy.NATURAL)
.build()
.intoFolder(targetFolderPath);
}
示例9: Swagger2MarkupResultHandlerUtf8
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
Swagger2MarkupResultHandlerUtf8(String outputDir, MarkupLanguage markupLanguage, String examplesFolderPath) {
this.outputDir = outputDir;
this.markupLanguage = markupLanguage;
this.examplesFolderPath = examplesFolderPath;
}
示例10: MarkupDocument
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
MarkupDocument(Swagger swagger, MarkupLanguage markupLanguage){
this.swagger = swagger;
this.markupLanguage = markupLanguage;
this.markupDocBuilder = MarkupDocBuilders.documentBuilder(markupLanguage);
}
示例11: withMarkupLanguage
import io.github.robwin.markup.builder.MarkupLanguage; //导入依赖的package包/类
/**
* Specifies the markup language which should be used to generate the files
*
* @param markupLanguage the markup language which is used to generate the files
* @return the Swagger2MarkupConverter.Builder
*/
public Builder withMarkupLanguage(MarkupLanguage markupLanguage) {
this.markupLanguage = markupLanguage;
return this;
}