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
.
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.
Before:
After: