This repository was archived by the owner on Jun 1, 2023. It is now read-only.
chain-wrap-components 0.0.4
Install from the command line:
Learn more about npm packages
$ npm install @dsaidgovsg/chain-wrap-components@0.0.4
Install via package.json:
"@dsaidgovsg/chain-wrap-components": "0.0.4"
About this version
This provides a helper function for Swagger UI, it allows:
- Use of
chainWrapComponents(plugin1, plugin2...)
to enable chaining for multiple plugins with the same components inwrapComponents
. - Add support to e.g.
swagger-ui v4.18.3
,pluginsOptions: {pluginLoadType: "chain"}
does not support chaining inwrapComponents
.
Add github npm registry to .npmrc
,
# .npmrc
always-auth = true
@dsaidgovsg:registry=https://npm.pkg.github.com
Install the package,
$ npm install @dsaidgovsg/chain-wrap-components
import otpAuthPlugin from '@dsaidgovsg/swagger-ui-plugin-otp-auth'
import samlAuthPlugin from '@dsaidgovsg/swagger-ui-plugin-saml-auth'
import chainWrapComponents from '@dsaidgovsg/chain-wrap-components'
// swagger-ui initialization
SwaggerUI({
plugins: [
// otpAuthPlugin and samlAuthPlugin both overriding wrapComponenrs
// e.g. wrapComponents: {AuthItem: ...}
chainWrapComponents(otpAuthPlugin, samlAuthPlugin),
...
]
})
Details
- chain-wrap-components
-
dsaidgovsg
- over 2 years ago
- MIT
- 10 dependencies
Assets
- chain-wrap-components-0.0.4.tgz
Download activity
- Total downloads 23
- Last 30 days 0
- Last week 0
- Today 0