Skip to content

Commit

Permalink
Parse environments extension
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlackReverand committed Sep 21, 2024
1 parent bad1302 commit f30117e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/bruno-app/src/utils/importers/openapi-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,25 @@ const parseOpenApiCollection = (data) => {
let baseUrl = servers[0] ? getDefaultUrl(servers[0]) : '';
let securityConfig = getSecurity(collectionData);

if(collectionData['x-bruno-environments']) {
collectionData['x-bruno-environments'].forEach(env => {
brunoCollection.environments.push({
uid: uuid(),
name: env.name,
variables: env.variables.map(variable => {
return {
uid: uuid(),
name: variable.name,
value: variable.value ?? '',
type: variable.type ?? 'text',
enabled: variable.enabled ?? true,
secret: variable.secret ?? false
};
})
});
});
}

let allRequests = Object.entries(collectionData.paths)
.map(([path, methods]) => {
return Object.entries(methods)
Expand Down

0 comments on commit f30117e

Please sign in to comment.