Skip to content

Commit

Permalink
1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Mar 14, 2016
1 parent fd9c32a commit afb422c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
20 changes: 14 additions & 6 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,21 @@ Converter.prototype.getResources = function(resourceListing, apiDeclarations) {
* @returns {array} - list of Swagger 2.0 tags
*/
Converter.prototype.buildTags = function(resourceListing, resources) {
var resourcePaths = this.mapEach(resources, function(resource) {
return resource.resourcePath;
});
var resourcePaths = [];

if (this.options.buildTagsFromPaths !== true) {
resourcePaths = this.mapEach(resources, function(resource) {
return resource.resourcePath;
});

//'resourcePath' is optional parameter and also frequently have invalid values
// if so than we discard all values and use resource paths for listing instead.
if (getLength(removeDuplicates(resourcePaths)) < getLength(resources)) {
resourcePaths = [];
}
}

//'resourcePath' is optional parameter and also frequently have invalid values
// if so than we discard all values and use resource paths for listing instead.
if (getLength(removeDuplicates(resourcePaths)) < getLength(resources)) {
if (isEmpty(resourcePaths)) {
resourcePaths = this.mapEach(resourceListing.apis, function(resource) {
return resource.path;
});
Expand Down
Loading

0 comments on commit afb422c

Please sign in to comment.