Skip to content

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

License

Notifications You must be signed in to change notification settings

sapphi-red/swagger-ui-plugin-enum-names

Repository files navigation

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>

About

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

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published