swagger-converter
Advanced tools
Comparing version 1.4.0 to 1.4.1
22
index.js
@@ -151,3 +151,4 @@ /* | ||
info: this.buildInfo(resourceListing), | ||
tags: undefinedIfEmpty(tags), | ||
//Order of tags depend on order of 'resourceListing.apis', so sort it | ||
tags: undefinedIfEmpty(sortBy(tags, 'name')), | ||
paths: undefinedIfEmpty(paths), | ||
@@ -972,3 +973,3 @@ securityDefinitions: undefinedIfEmpty(securityDefinitions), | ||
* Remove duplicates of an array | ||
* @params collection {array} | ||
* @param collection {array} | ||
* @returns {array} - collection without duplicates | ||
@@ -984,3 +985,3 @@ */ | ||
* Strip common prefix from paths | ||
* @params paths {array} | ||
* @param paths {array} | ||
* @returns {array} - path with remove common part | ||
@@ -996,1 +997,16 @@ */ | ||
} | ||
/* | ||
* Sort array by value of specified attribute | ||
* @param array {array} - array to sort | ||
* @param attr {attr} - attribute to sort by | ||
* @returns {array} - sorted array | ||
*/ | ||
function sortBy(array, attr) { | ||
assert(Array.isArray(array)); | ||
return array.sort(function(a,b) { | ||
a = a[attr]; | ||
b = b[attr]; | ||
return (a < b) ? -1 : ((a > b) ? 1 : 0); | ||
}); | ||
} |
{ | ||
"name": "swagger-converter", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Converts Swagger documents from version 1.x to version 2.0", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,3 +25,3 @@ # Swagger Converter | ||
##### convert function | ||
`converter` accept accept following arguments: | ||
`convert` accept accept following arguments: | ||
@@ -28,0 +28,0 @@ * `resourceListing`(required) is Swagger 1.x entry point file. |
@@ -1041,10 +1041,10 @@ { | ||
{ | ||
"description": "Operations about store", | ||
"name": "store" | ||
}, | ||
{ | ||
"description": "Operations about user", | ||
"name": "user" | ||
}, | ||
{ | ||
"description": "Operations about store", | ||
"name": "store" | ||
} | ||
] | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
371876
8814