Skip to content

Commit

Permalink
Bugfix/openapispec empty tag (#2935)
Browse files Browse the repository at this point in the history
* test: added test for self closing tags in xml-json parser

* fix: allows import of openapispec with empty string as tags

---------

Co-authored-by: Anusree Subash <anusree@usebruno.com>
  • Loading branch information
anusreesubash and Anusree Subash authored Sep 15, 2024
1 parent 3dfb27d commit f31c997
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/bruno-app/src/utils/importers/openapi-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,16 @@ const groupRequestsByTags = (requests) => {
each(requests, (request) => {
let tags = request.operationObject.tags || [];
if (tags.length > 0) {
let tag = tags[0]; // take first tag
if (!_groups[tag]) {
_groups[tag] = [];
let tag = tags[0].trim(); // take first tag and trim whitespace

if (tag) {
if (!_groups[tag]) {
_groups[tag] = [];
}
_groups[tag].push(request);
} else {
ungrouped.push(request);
}
_groups[tag].push(request);
} else {
ungrouped.push(request);
}
Expand Down

0 comments on commit f31c997

Please sign in to comment.