swagger-ui-plugin-enum-names
v4.1.3
Published
A plugin for Swagger UI to show x-enum-varnames / x-enumNames and x-enum-descriptions.
Downloads
180
Readme
swagger-ui-plugin-enum-names
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>