Parse environments extension

This commit is contained in:
TheBlackReverand 2024-04-15 18:28:06 +02:00
parent fd22ff8962
commit 55850cb43b

View File

@ -406,6 +406,25 @@ export const parseOpenApiCollection = (data) => {
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)