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

swagger-jsdoc

Package Overview
Dependencies
Maintainers
4
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-jsdoc - npm Package Compare versions

Comparing version 6.2.0 to 6.2.1

2

package.json
{
"name": "swagger-jsdoc",
"description": "Generates swagger doc based on JSDoc",
"version": "6.2.0",
"version": "6.2.1",
"engines": {

@@ -6,0 +6,0 @@ "node": ">=12.0.0"

@@ -72,2 +72,3 @@ # swagger-jsdoc

- Swagger 2
- AsyncAPI 2.0

@@ -74,0 +75,0 @@ ## Documentation

@@ -21,3 +21,2 @@ const doctrine = require('doctrine');

function prepare(definition) {
let version;
const swaggerObject = JSON.parse(JSON.stringify(definition));

@@ -39,15 +38,25 @@ const specificationTemplate = {

'components',
'channels',
],
v4: ['components', 'channels'],
};
if (swaggerObject.openapi) {
version = 'v3';
} else if (swaggerObject.swagger) {
version = 'v2';
} else {
version = 'v2';
const getVersion = () => {
if (swaggerObject.asyncapi) {
return 'v4';
}
if (swaggerObject.openapi) {
return 'v3';
}
if (swaggerObject.swagger) {
return 'v2';
}
swaggerObject.swagger = '2.0';
}
return 'v2';
};
const version = getVersion();
specificationTemplate[version].forEach((property) => {

@@ -54,0 +63,0 @@ swaggerObject[property] = swaggerObject[property] || {};

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