https://github.com/beapp/swagger-ui-plugin-extra-description
Swagger-ui plugin to display extra description blocks between info and paths
https://github.com/beapp/swagger-ui-plugin-extra-description
Last synced: 11 months ago
JSON representation
Swagger-ui plugin to display extra description blocks between info and paths
- Host: GitHub
- URL: https://github.com/beapp/swagger-ui-plugin-extra-description
- Owner: BeApp
- Created: 2021-04-28T20:28:45.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T13:56:26.000Z (about 5 years ago)
- Last Synced: 2025-06-29T21:17:46.894Z (12 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/swagger-ui-plugin-extra-description
- Size: 70.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
This [Swagger-UI](https://github.com/swagger-api/swagger-ui) plugin allows to display multiple collapsible sections between the documentation's info and the paths list.
It works by wrapping the `InfoContainer` component to inject custom components.
# Installation
```
npm i swagger-ui-plugin-extra-description
```
# Usage
Add the plugin in the configuration object of SwaggerUI, and provides a list of sections like this :
```js
import { ExtraDescriptionPluginFactory } from 'swagger-ui-plugin-extra-description';
SwaggerUI({
// ...
plugins: [
ExtraDescriptionPluginFactory([
{
title: "Important section",
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis ...",
forceOpen: true
}, {
title: "Changelog",
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis ..."
}
]
]
})
```
Once the plugin has been applied, two components will be accessible if needed : `ExtraDescriptions` and `ExtraDescription`