From 00bc93d3ac5cfd66453346fe797cc4b212973676 Mon Sep 17 00:00:00 2001 From: Abhishek S Lal Date: Wed, 1 Apr 2026 21:14:31 +0530 Subject: [PATCH] fix: ensure tags are always an array in bruToJson function (#7631) Updated the bruToJson function to coerce the tags property into an array, ensuring consistent data structure when processing JSON input. This change enhances the reliability of the function by preventing potential errors when tags are not provided as an array. --- packages/bruno-cli/src/utils/bru.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/bruno-cli/src/utils/bru.js b/packages/bruno-cli/src/utils/bru.js index c132891e1..635f80af2 100644 --- a/packages/bruno-cli/src/utils/bru.js +++ b/packages/bruno-cli/src/utils/bru.js @@ -71,12 +71,13 @@ const bruToJson = (bru) => { } const sequence = _.get(json, 'meta.seq'); + const tags = _.get(json, 'meta.tags', []); const transformedJson = { type: requestType, name: _.get(json, 'meta.name'), seq: !_.isNaN(sequence) ? Number(sequence) : 1, settings: _.get(json, 'settings', {}), - tags: _.get(json, 'meta.tags', []), + tags: Array.isArray(tags) ? tags : [], examples: _.get(json, 'examples', []), request: { url: _.get(json, requestType === 'grpc-request' ? 'grpc.url' : 'http.url'),