How to generate offline Swagger API docs?

前端 未结 6 1109
难免孤独
难免孤独 2020-12-30 02:42

I have a spring boot MVC java Web app. I\'ve been able to integrate Springfox for API documentation. I can visually see all of the APIs when server is up and running.

相关标签:
6条回答
  • 2020-12-30 03:09

    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.

    0 讨论(0)
  • 2020-12-30 03:10

    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>).

    0 讨论(0)
  • 2020-12-30 03:13

    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.

    0 讨论(0)
  • 2020-12-30 03:14

    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! :)

    0 讨论(0)
  • 2020-12-30 03:16

    You might take a look at https://www.DynamicApis.com. You can create an API portal and upload your swagger JSON documents. This site takes the Swagger document and generates a much nicer user interface for your API along with some pretty cool tooling.

    Here is an example of a portal API that has documentation on one of their APIs.

    0 讨论(0)
  • 2020-12-30 03:27

    Pretty-swag is a UI for Swagger Specification V2 capable of generating static HTML an other formats. It is inspired by Swagger Editor.

    checkout https://github.com/twskj/pretty-swag

    0 讨论(0)
提交回复
热议问题