Skip to content
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

@dsaidgovsg/chain-wrap-components

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 in wrapComponents.
  • Add support to e.g. swagger-ui v4.18.3, pluginsOptions: {pluginLoadType: "chain"} does not support chaining in wrapComponents.

Prerequisites

Install

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

Usage

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


Assets

  • chain-wrap-components-0.0.4.tgz

Download activity

  • Total downloads 23
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all