forked from extern/bruno
handle non-methods on OpenAPI import
This commit is contained in:
parent
471e1780a0
commit
e77a9adebd
@ -326,17 +326,21 @@ const parseOpenApiCollection = (data) => {
|
|||||||
|
|
||||||
let allRequests = Object.entries(collectionData.paths)
|
let allRequests = Object.entries(collectionData.paths)
|
||||||
.map(([path, methods]) => {
|
.map(([path, methods]) => {
|
||||||
return Object.entries(methods).map(([method, operationObject]) => {
|
return Object.entries(methods)
|
||||||
return {
|
.filter(([method, op]) => {
|
||||||
method: method,
|
['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'].includes(method.toLowerCase());
|
||||||
path: path,
|
})
|
||||||
operationObject: operationObject,
|
.map(([method, operationObject]) => {
|
||||||
global: {
|
return {
|
||||||
server: baseUrl,
|
method: method,
|
||||||
security: securityConfig
|
path: path,
|
||||||
}
|
operationObject: operationObject,
|
||||||
};
|
global: {
|
||||||
});
|
server: baseUrl,
|
||||||
|
security: securityConfig
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.reduce((acc, val) => acc.concat(val), []); // flatten
|
.reduce((acc, val) => acc.concat(val), []); // flatten
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user