mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-03 04:29:09 +01:00
Parse environments extension
This commit is contained in:
parent
fd22ff8962
commit
55850cb43b
@ -406,6 +406,25 @@ export const parseOpenApiCollection = (data) => {
|
|||||||
|
|
||||||
let securityConfig = getSecurity(collectionData);
|
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)
|
let allRequests = Object.entries(collectionData.paths)
|
||||||
.map(([path, methods]) => {
|
.map(([path, methods]) => {
|
||||||
return Object.entries(methods)
|
return Object.entries(methods)
|
||||||
|
Loading…
Reference in New Issue
Block a user