I've tried using https://doctoolchain.github.io/docToolchain/ to create an HTML or PDF doc that includes a swagger/openapi yaml file. It looks like the only output for this is into confluence which also requires an additional confluence plugin. Is this the only option at this time? I am able to do other asciidoc and diagram formatting using docToolchain and I'd be very happy to include swagger. I can publish to confluence but cannot get either of the swagger plugins added to our system.

1

There are 1 best solutions below

0
Ewoks On

Beside being able to publish it to confluence, you could generate HTML or PDF files. For this to work it is necessary to configure it properly and to execute command for generating respective output format (generateHTML|generatePDF). Currently, result will be static (no interactive Swagger-UI page, so you will not be able to make any requests from generated output).

Regarding configuration, you would need to declare location of OpenAPI spec as json file in config.groovy, like:

openApi.with {
    specFile = 'src/docs/petstore-v2.0.yaml' 
    infoUrl = 'https://my-api.company.com'
    infoEmail = '[email protected]'
}

InfoUrl and InfoEmail are just meta parameters which will be used for the HTML/PDF header.

Interactive SwaggerUI generation via docToolchain is one of the features we would like to implement soon, but unfortunately we can't give any ETA at the moment. Nevertheless, PRs at github project are welcomed :)