mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-21 23:43:15 +01:00
added validations for spec and ref (#2962)
Co-authored-by: Anusree Subash <anusree@usebruno.com>
This commit is contained in:
parent
ab8afed8f9
commit
c85d7b0c77
@ -229,7 +229,7 @@ const transformOpenapiRequestItem = (request) => {
|
||||
return brunoRequestItem;
|
||||
};
|
||||
|
||||
const resolveRefs = (spec, components = spec.components, visitedItems = new Set()) => {
|
||||
const resolveRefs = (spec, components = spec?.components, visitedItems = new Set()) => {
|
||||
if (!spec || typeof spec !== 'object') {
|
||||
return spec;
|
||||
}
|
||||
@ -253,7 +253,7 @@ const resolveRefs = (spec, components = spec.components, visitedItems = new Set(
|
||||
let ref = components;
|
||||
|
||||
for (const key of refKeys) {
|
||||
if (ref[key]) {
|
||||
if (ref && ref[key]) {
|
||||
ref = ref[key];
|
||||
} else {
|
||||
// Handle invalid references gracefully?
|
||||
|
Loading…
Reference in New Issue
Block a user