mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Merge branch 'split/develop/multiFileSupport' into fix/formatForEachroot
This commit is contained in:
@@ -92,7 +92,7 @@ const { formatDataPath, checkIsCorrectType, isKnownType } = require('./common/sc
|
||||
{ getRelatedFiles } = require('./relatedFiles'),
|
||||
{ compareVersion } = require('./common/versionUtils.js'),
|
||||
parse = require('./parse'),
|
||||
{ getBundleContentAndComponents } = require('./bundle.js'),
|
||||
{ getBundleContentAndComponents, parseFileOrThrow } = require('./bundle.js'),
|
||||
MULTI_FILE_API_TYPE_ALLOWED_VALUE = 'multiFile';
|
||||
/* eslint-enable */
|
||||
|
||||
@@ -4901,7 +4901,7 @@ module.exports = {
|
||||
mapProcessRelatedFiles(rootFiles, inputData, origin, version, format, toBundle = false) {
|
||||
let bundleFormat = format,
|
||||
parsedRootFiles = rootFiles.map((rootFile) => {
|
||||
let parsedContent = this.parseFileOrThrow(rootFile.content);
|
||||
let parsedContent = parseFileOrThrow(rootFile.content);
|
||||
return { fileName: rootFile.fileName, content: rootFile.content, parsed: parsedContent };
|
||||
}).filter((rootWithParsedContent) => {
|
||||
// bundleFormat = bundleFormat ? bundleFormat : rootWithParsedContent.parsed.inputFormat;
|
||||
@@ -4985,13 +4985,5 @@ module.exports = {
|
||||
throw new Error('"Path" of the data element should be provided');
|
||||
}
|
||||
},
|
||||
|
||||
parseFileOrThrow(fileContent) {
|
||||
const result = parse.getOasObject(fileContent);
|
||||
if (result.result === false) {
|
||||
throw new ParseError(result.reason);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
MULTI_FILE_API_TYPE_ALLOWED_VALUE
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user