simple-swagger-doc

command module
v0.0.0-...-94ce6d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

README

Simple Swagger API Doc

This project helps to create a simple markdown version from Swagger API specification.

Often developers create the API specification using swagger editor and use swagger UI to host the API in a browsable manner. But, it is hard to take a PDF version or integrate with other documentation systems, like confluence. This project solves that by simply exporting the API into a markdown. From markdown, it is easier to convert to other formats using other tools.

Preview

How to run?

You need to have the json version of the API. You can download your API in json format using the swagger editor. Once you have it, you can convert into a simple markdown as

$ go run main.go samples/petstore.json 

If you have downloaded the binary, run it as

$ ./simple-swagger-doc samples/petstore-openapi.json

Converting into HTML

You can convert the markdown into html using the pandoc utility.

$ go run main.go samples/petstore-openapi.json | \
    pandoc -f markdown -css=github-pandoc.css 

Using with confluence

You can create a "CSS StyleSheet" macro in your page and add the content of the file github-confluence-css-minifieid.css. The create a HTML macro and add the content of the generated HTML above.

Samples

You can refer to the final output of some of the samples

Supported Swagger API versions

I have tested few samples of swagger schema version 2.0 and openapi 3.0.1

Limitations

This tool supports most of the basic directives of the Swagger API. Some of the things that will not work yet are

  • External reference documents for schema/components
  • OpenAPI components other than Schema. But, this is trivial to fix

Also, not all content in the API is transfered to the markdown to avoid cluttering. The resulting document is very simple and readable for other developers and architects. This will be gradually enhanced.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL