Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swagger-ui-express

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-ui-express - npm Package Compare versions

Comparing version 4.0.4 to 4.0.5

2

package.json
{
"name": "swagger-ui-express",
"version": "4.0.4",
"version": "4.0.5",
"description": "Swagger UI Express",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -87,2 +87,4 @@ # Swagger UI Express

For all the available options, refer to [Swagger UI Configuration](https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md)
### Custom CSS styles

@@ -143,3 +145,3 @@

To load your swagger from a url instead of injecting the document, pass `null` as the first parameter, and pass the relative or absolute URL as the 'swaggerUrl' property of the options to the setup function.
To load your swagger from a url instead of injecting the document, pass `null` as the first parameter, and pass the relative or absolute URL as the 'url' property to 'swaggerOptions' in the setup function.

@@ -152,3 +154,5 @@ ```javascript

var options = {
swaggerUrl: 'http://petstore.swagger.io/v2/swagger.json'
swaggerOptions: {
url: 'http://petstore.swagger.io/v2/swagger.json'
}
}

@@ -159,2 +163,31 @@

To load multiple swagger documents from urls as a dropdown in the explorer bar, pass an array of object with `name` and `url` to 'urls' property to 'swaggerOptions' in the setup function.
```javascript
const express = require('express');
const app = express();
const swaggerUi = require('swagger-ui-express');
var options = {
explorer: true,
swaggerOptions: {
urls: [
{
url: 'http://petstore.swagger.io/v2/swagger.json',
name: 'Spec1'
},
{
url: 'http://petstore.swagger.io/v2/swagger.json',
name: 'Spec2'
}
]
}
}
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(null, options));
```
Make sure 'explorer' option is set to 'true' in your setup options for the dropdown to be visible.
### Load swagger from yaml file

@@ -161,0 +194,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc