Adding bundle files proces

This commit is contained in:
Erik Mendoza
2022-05-20 16:50:07 -05:00
parent 6223594703
commit 4aa298b399
16 changed files with 472 additions and 188 deletions

View File

@@ -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