swagger-ui-plugin-enum-names

4.1.3 • Public • Published

swagger-ui-plugin-enum-names

image

A plugin for Swagger UI to show x-enum-varnames / x-enumNames and x-enum-descriptions.

x-enum-varnames/x-enum-descriptions are supported by openapi-generator (docs).
Also x-enumNames is supported by NSwag (docs).

Usage

With npm

$ npm i swagger-ui-plugin-enum-names

Pass this plugin to options.

const { EnumNamesPlugin } = require('swagger-ui-plugin-enum-names')

SwaggerUI({
  plugins: [
    EnumNamesPlugin
  ]
})

And import swagger-ui-plugin-enum-names/dist/index.css in some way.

With unpkg

<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist/swagger-ui.css" />
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-plugin-enum-names/dist/index.css" />

<script src="https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"></script>
<script src="https://unpkg.com/swagger-ui-plugin-enum-names"></script>

<script>
window.onload = () => {
  SwaggerUIBundle({
    plugins: [
      EnumNamesPlugin.EnumNamesPlugin
    ]
  })
}
</script>

Readme

Keywords

Package Sidebar

Install

npm i swagger-ui-plugin-enum-names

Weekly Downloads

94

Version

4.1.3

License

Apache-2.0

Unpacked Size

35.6 kB

Total Files

9

Last publish

Collaborators

  • sapphi-red