Skip to content

shockey/swagger-ui-plugin-cornify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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