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

swagger-jsdoc

Package Overview
Dependencies
Maintainers
3
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.0.8 to 6.0.9

7

CHANGELOG.md
## Change Log
### v6.0.7 (2021/02/26 14:32 +00:00)
### v6.0.7 (2021/03/01 15:19 +00:00)
- [#253](https://github.com/Surnet/swagger-jsdoc/pull/253) fix(specification): apply fix for multiple anchors (#253) (@goldsziggy)
### v7.0.0-rc.3 (2021/02/26 14:33 +00:00)
- [8873370](https://github.com/Surnet/swagger-jsdoc/commit/887337050ec3b2d246d2fa9a9bd3570b3746d379) Update docs (@kalinchernev)
- [#250](https://github.com/Surnet/swagger-jsdoc/pull/250) Update FIRST-STEPS.md (#250) (@azizkale)

@@ -6,0 +11,0 @@ - [da152ea](https://github.com/Surnet/swagger-jsdoc/commit/da152eaf81656b77f49628005225ef7e0f647c9e) Update docs (@kalinchernev)

4

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

@@ -22,3 +22,5 @@ "node": ">=12.0.0"

"doctrine": "3.0.0",
"github-changes": "^2.0.2",
"glob": "7.1.6",
"lodash.mergewith": "^4.6.2",
"swagger-parser": "10.0.2",

@@ -25,0 +27,0 @@ "yaml": "2.0.0-1"

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

extractAnnotations,
mergeDeep,
extractYamlFromJsDoc,

@@ -99,3 +100,2 @@ isTagPresentInTags,

let specification = swaggerObject;
parser.parse(swaggerObject, (err, api) => {

@@ -142,9 +142,8 @@ if (!err) {

];
if (commonProperties.includes(property)) {
for (const definition of Object.keys(annotation[property])) {
swaggerObject[property][definition] = {
...swaggerObject[property][definition],
...annotation[property][definition],
};
swaggerObject[property][definition] = mergeDeep(
swaggerObject[property][definition],
annotation[property][definition]
);
}

@@ -165,6 +164,6 @@ } else if (property === 'tags') {

// Paths which are not defined as "paths" property, starting with a slash "/"
swaggerObject.paths[property] = {
...swaggerObject.paths[property],
...annotation[property],
};
swaggerObject.paths[property] = mergeDeep(
swaggerObject.paths[property],
annotation[property]
);
}

@@ -243,3 +242,2 @@ }

.split(' at line')[0];
const anchor = yamlDocsAnchors.get(refErr);

@@ -246,0 +244,0 @@ const anchorString = anchor.cstNode.toString();

const fs = require('fs');
const path = require('path');
const glob = require('glob');
const mergeWith = require('lodash.mergewith');

@@ -133,2 +134,13 @@ /**

/**
* A recursive deep-merge that ignores null values when merging.
* This returns the merged object and does not mutate.
* @param {object} first the first object to get merged
* @param {object} second the second object to get merged
*/
function mergeDeep(first, second) {
return mergeWith({}, first, second, (a, b) => (b === null ? a : undefined));
}
module.exports.mergeDeep = mergeDeep;
module.exports.convertGlobPaths = convertGlobPaths;

@@ -135,0 +147,0 @@ module.exports.hasEmptyProperty = hasEmptyProperty;

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