mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Adding bundle files proces
This commit is contained in:
@@ -4826,13 +4826,15 @@ module.exports = {
|
||||
return data;
|
||||
},
|
||||
|
||||
getComponentsObject(parsedRootFiles, inputData, origin, version) {
|
||||
getBundledFileData(parsedRootFiles, inputData, origin, version) {
|
||||
const data = parsedRootFiles.map((root) => {
|
||||
let calledAs = [],
|
||||
componentsData = getRelatedFilesAndBundleData(root, inputData, origin, version, calledAs);
|
||||
return componentsData;
|
||||
bundleData = getRelatedFilesAndBundleData(root, inputData, origin, version, calledAs);
|
||||
return bundleData;
|
||||
});
|
||||
return data;
|
||||
let bundledFile = data[0].fileContent;
|
||||
bundledFile.components = data[0].components;
|
||||
return { rootFile: { path: parsedRootFiles[0].fileName }, bundledContent: bundledFile };
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -4855,9 +4857,10 @@ module.exports = {
|
||||
return compareVersion(version, rootWithParsedContent.parsed.oasObject.openapi);
|
||||
}),
|
||||
data = toBundle ?
|
||||
this.getComponentsObject(parsedRootFiles, inputData, origin, version) :
|
||||
this.getBundledFileData(parsedRootFiles, inputData, origin, version) :
|
||||
this.getRelatedFilesData(parsedRootFiles, inputData, origin);
|
||||
return data;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -4874,7 +4877,7 @@ module.exports = {
|
||||
res = {
|
||||
result: true,
|
||||
output: {
|
||||
type: toBundle ? 'bundle' : 'relatedFiles',
|
||||
type: toBundle ? 'bundledContent' : 'relatedFiles',
|
||||
specification: {
|
||||
type: 'OpenAPI',
|
||||
version: version
|
||||
|
||||
Reference in New Issue
Block a user