Swagger2Markup

Java code posted by cascer1
created at 05 Sep 15:57

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Path swaggerFile = Paths.get("work/input/spec.yaml");
Path outputFile = Paths.get("work/temp/api");

Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
  .withMarkupLanguage(MarkupLanguage.ASCIIDOC)
  .withOutputLanguage(Language.EN)
  .withPathsGroupedBy(GroupBy.TAGS)
  .withGeneratedExamples()
  .withInterDocumentCrossReferences()
  .build();

Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(swaggerFile)
  .withConfig(config)
  .build();
  .toFile(outputFile);
509 Bytes in 2 ms with coderay