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

express-swagger-generator

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-swagger-generator - npm Package Compare versions

Comparing version 1.1.8 to 1.1.9

test/router.js

42

lib/swagger.js

@@ -65,8 +65,37 @@ /**

function parseSchema(obj) {
if (!obj.name) return undefined;
const spl = obj.name.split('.');
if (spl.length > 1 && spl[1] == 'model') {
return {"$ref": "#/definitions/" + spl[0]};
if (!(obj.name || obj.applications)) return undefined;
if (obj.name) {
const spl = obj.name.split('.');
if (spl.length > 1 && spl[1] == 'model') {
return {"$ref": "#/definitions/" + spl[0]};
}
else return undefined;
}
else return undefined;
if (obj.applications) {
if (obj.applications.length === 1) {
return {
type: obj.expression.name.toLowerCase(),
items: {
"$ref": "#/definitions/" + obj.applications[0].name
}
}
}
let oneOf = []
for (let i in obj.applications) {
oneOf.push({
"$ref": "#/definitions/" + obj.applications[i].name
})
}
return {
type: obj.expression.name.toLowerCase(),
items: {
oneOf: oneOf
}
}
}
return undefined
}

@@ -92,4 +121,5 @@

let description = tags[i]['description'].split("-"), key = description[0].trim()
rets[key] = {
description: description[1].trim(),
description: description[1] ? description[1].trim() : '',
headers: headers[key]

@@ -96,0 +126,0 @@ };

2

package.json
{
"name": "express-swagger-generator",
"version": "1.1.8",
"version": "1.1.9",
"description": "Generates swagger doc & ui based on express existing routes.",

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

@@ -104,2 +104,3 @@ ### Express Swagger Generator

* @returns {Product.model} default - Unexpected error
* @returns {Array.<Point>} Point - Some description for point
* @headers {integer} 200.X-Rate-Limit - calls per hour allowed by the user

@@ -106,0 +107,0 @@ * @headers {string} 200.X-Expires-After - date in UTC when token expires

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