Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

swagger-ui-plugin-enum-names

sapphi-red120Apache-2.04.1.3

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

swagger

readme

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>