mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-24 08:53:30 +01:00
Bugfix/openapispec empty tag (#2935)
* 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>
This commit is contained in:
parent
3dfb27d447
commit
f31c997fed
@ -283,11 +283,16 @@ const groupRequestsByTags = (requests) => {
|
|||||||
each(requests, (request) => {
|
each(requests, (request) => {
|
||||||
let tags = request.operationObject.tags || [];
|
let tags = request.operationObject.tags || [];
|
||||||
if (tags.length > 0) {
|
if (tags.length > 0) {
|
||||||
let tag = tags[0]; // take first tag
|
let tag = tags[0].trim(); // take first tag and trim whitespace
|
||||||
if (!_groups[tag]) {
|
|
||||||
_groups[tag] = [];
|
if (tag) {
|
||||||
|
if (!_groups[tag]) {
|
||||||
|
_groups[tag] = [];
|
||||||
|
}
|
||||||
|
_groups[tag].push(request);
|
||||||
|
} else {
|
||||||
|
ungrouped.push(request);
|
||||||
}
|
}
|
||||||
_groups[tag].push(request);
|
|
||||||
} else {
|
} else {
|
||||||
ungrouped.push(request);
|
ungrouped.push(request);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user