How to generate offline Swagger API docs?

Springfox allows you to easily create a Swagger tester/API docs based on your Spring annotations.

Swagger itself has some tools to allow you to generate offline/static documentation:

  • The Swagger Editor has several ways of generating documentation listed in the Generate Client menu
  • The Swagger Codegen module allows you to generate a static and dynamic HTML document

Both of them require a Swagger YAML or JSON file. In case you don't have a Swagger definition in YAML/JSON because you're using Springfox, you can use the generated file used for Swagger UI (/v2/api-docs?group=<group name>).


Open the live swagger HTML. click on expanding all the operations. Then save the HTML as PDF.

This should give you a decent PDF API documentation with all the details in it.


You can try "HTML" or "Dynamic HTML" under the "Generate Client" menu in https://editor.swagger.io. For any issue/feedback with the static doc, please report in the Swagger Codegen Github repo.

editor.swagger.io leverages https://generator.swagger.io to generate code and generator.swagger.io (Swagger Generator) is part of the Swagger Codegen project.


Swagger has tool for generating offline docs.

The tool is "Swagger2Markup" which is located @ Github.

The output of "Swagger2Markup" can be used as an alternative to swagger-ui and can be served as static content.

Here is an Example

Good luck! :)