swagger-jsdoc
Advanced tools
Comparing version 6.0.8 to 6.0.9
## 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) |
{ | ||
"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; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70350
479
7
+ Addedgithub-changes@^2.0.2
+ Addedlodash.mergewith@^4.6.2
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@octokit/auth-token@2.5.0(transitive)
+ Added@octokit/core@3.6.0(transitive)
+ Added@octokit/endpoint@6.0.12(transitive)
+ Added@octokit/graphql@4.8.0(transitive)
+ Added@octokit/openapi-types@12.11.0(transitive)
+ Added@octokit/plugin-paginate-rest@2.21.3(transitive)
+ Added@octokit/plugin-request-log@1.0.4(transitive)
+ Added@octokit/plugin-rest-endpoint-methods@5.16.2(transitive)
+ Added@octokit/request@5.6.3(transitive)
+ Added@octokit/request-error@2.1.0(transitive)
+ Added@octokit/rest@18.12.0(transitive)
+ Added@octokit/types@6.41.0(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@3.2.14.3.0(transitive)
+ Addedapplication-config@2.0.0(transitive)
+ Addedapplication-config-path@0.1.1(transitive)
+ Addedbefore-after-hook@2.2.3(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedchalk@2.4.23.0.0(transitive)
+ Addedcli-cursor@3.1.0(transitive)
+ Addedcli-spinners@2.9.2(transitive)
+ Addedclone@1.0.4(transitive)
+ Addedcolor-convert@1.9.32.0.1(transitive)
+ Addedcolor-name@1.1.31.1.4(transitive)
+ Addedcommander@6.2.1(transitive)
+ Addeddefaults@1.0.4(transitive)
+ Addeddeprecation@2.3.1(transitive)
+ Addeddetect-indent@6.1.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedghauth@5.0.2(transitive)
+ Addedgithub-changes@2.0.3(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-flag@3.0.04.0.0(transitive)
+ Addedimurmurhash@0.1.4(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-interactive@1.0.0(transitive)
+ Addedis-plain-obj@2.1.0(transitive)
+ Addedis-plain-object@5.0.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedload-json-file@6.2.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash.mergewith@4.6.2(transitive)
+ Addedlog-symbols@3.0.0(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedmoment-timezone@0.5.46(transitive)
+ Addedmute-stream@0.0.8(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedora@4.1.1(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedread@1.0.7(transitive)
+ Addedrestore-cursor@3.1.0(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsort-keys@4.2.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedstrip-bom@4.0.0(transitive)
+ Addedsupports-color@5.5.07.2.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedtype-fest@0.6.0(transitive)
+ Addedtypedarray-to-buffer@3.1.5(transitive)
+ Addeduniversal-user-agent@6.0.1(transitive)
+ Addedwcwidth@1.0.1(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwrite-file-atomic@3.0.3(transitive)
+ Addedwrite-json-file@4.3.0(transitive)