mirror of
https://github.com/usebruno/bruno.git
synced 2025-03-14 23:08:20 +01:00
Merge pull request #745 from aviskase/main
OpenAPI import - filter out non-methods on path item objects parsing
This commit is contained in:
commit
1026addc8f
@ -326,17 +326,21 @@ const parseOpenApiCollection = (data) => {
|
||||
|
||||
let allRequests = Object.entries(collectionData.paths)
|
||||
.map(([path, methods]) => {
|
||||
return Object.entries(methods).map(([method, operationObject]) => {
|
||||
return {
|
||||
method: method,
|
||||
path: path,
|
||||
operationObject: operationObject,
|
||||
global: {
|
||||
server: baseUrl,
|
||||
security: securityConfig
|
||||
}
|
||||
};
|
||||
});
|
||||
return Object.entries(methods)
|
||||
.filter(([method, op]) => {
|
||||
['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'].includes(method.toLowerCase());
|
||||
})
|
||||
.map(([method, operationObject]) => {
|
||||
return {
|
||||
method: method,
|
||||
path: path,
|
||||
operationObject: operationObject,
|
||||
global: {
|
||||
server: baseUrl,
|
||||
security: securityConfig
|
||||
}
|
||||
};
|
||||
});
|
||||
})
|
||||
.reduce((acc, val) => acc.concat(val), []); // flatten
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user