Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pooja-bruno committed Jan 20, 2025
1 parent cc61da3 commit 5cf450b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/bruno-app/src/utils/importers/openapi-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const transformOpenapiRequestItem = (request) => {

const transformPath = (path) => {
const segments = path.split('/');
const transformedSegments = segments.map(segment => {

const transformedSegments = segments.map((segment) => {
if (segment.match(/^\{.*\}$/)) {
const paramName = segment.slice(1, -1);
return `:${paramName}`;
Expand All @@ -82,7 +82,7 @@ const transformOpenapiRequestItem = (request) => {

const pathParams = [];
const urlSegments = transformedPath.split('/');
urlSegments.forEach(segment => {
urlSegments.forEach((segment) => {
if (segment.startsWith(':')) {
const paramName = segment.slice(1);
pathParams.push({
Expand Down Expand Up @@ -377,7 +377,7 @@ const openAPIRuntimeExpressionToScript = (expression) => {
};

const getPathSegments = (path) => {
return path.split('/').filter(segment => segment);
return path.split('/').filter((segment) => segment);
};

const createFolderStructure = (paths) => {
Expand All @@ -396,14 +396,14 @@ const createFolderStructure = (paths) => {
};

// Process each request and create folder structure
paths.forEach(request => {
paths.forEach((request) => {
const segments = getPathSegments(request.path);
let currentLevel = folderTree;

// Create folders for each segment
for (let i = 0; i < segments.length; i++) {
const segment = segments[i];

if (i === segments.length - 1) {
const folder = getOrCreateFolder(currentLevel, segment);
folder.requests.push(request);
Expand Down Expand Up @@ -491,7 +491,7 @@ export const parseOpenApiCollection = (data) => {
type: 'text',
enabled: true,
secret: false
},
}
]
});
});
Expand Down

0 comments on commit 5cf450b

Please sign in to comment.