shockey / swagger-ui-plugin-cornify

Cornify plugin for Swagger-UI v3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm version

swagger-ui-cornify

Cornify plugin for Swagger-UI v3.

This is a lighthearted example of how to create an external plugin for Swagger-UI. This project has a minimal Webpack build pipeline that creates bundles for browser consumption.

The plugin is available on npm as swagger-ui-cornify, and minified release copies are attached to each GitHub Release.

If you use the script directly, the module will be exposed on the global scope as SwaggerUICornify.

How to use

Load this plugin (either through npm or directly), and provide it to Swagger-UI when you call it:

SwaggerUI({
  url: "http://petstore.swagger.io/v2/petstore.yaml",
  plugins: [
    SwaggerUICornify
  ]
})

If/when the API definition you're viewing contains an x-cornify: true statement, magic will happen.

In action

Before:

Before

After:

After

About

Cornify plugin for Swagger-UI v3

License:MIT License


Languages

Language:JavaScript 100.0%