mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Add reusable referenced path item object
Add reusable referenced path item object
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
const { ParseError } = require('./common/ParseError.js');
|
||||
|
||||
const { formatDataPath, checkIsCorrectType, isKnownType } = require('./common/schemaUtilsCommon.js'),
|
||||
{ getConcreteSchemaUtils } = require('./common/versionUtils.js'),
|
||||
{ getConcreteSchemaUtils, SWAGGER_VERSION } = require('./common/versionUtils.js'),
|
||||
async = require('async'),
|
||||
sdk = require('postman-collection'),
|
||||
schemaFaker = require('../assets/json-schema-faker.js'),
|
||||
@@ -4874,9 +4874,9 @@ module.exports = {
|
||||
*
|
||||
* @returns {object} process result { rootFile, bundledContent }
|
||||
*/
|
||||
getBundledFileData(parsedRootFiles, inputData, origin, format) {
|
||||
getBundledFileData(parsedRootFiles, inputData, origin, format, version) {
|
||||
const data = parsedRootFiles.map((root) => {
|
||||
let bundleData = getBundleContentAndComponents(root, inputData, origin);
|
||||
let bundleData = getBundleContentAndComponents(root, inputData, origin, version);
|
||||
return bundleData;
|
||||
});
|
||||
|
||||
@@ -4904,10 +4904,13 @@ module.exports = {
|
||||
let parsedContent = parseFileOrThrow(rootFile.content);
|
||||
return { fileName: rootFile.fileName, content: rootFile.content, parsed: parsedContent };
|
||||
}).filter((rootWithParsedContent) => {
|
||||
return compareVersion(version, rootWithParsedContent.parsed.oasObject.openapi);
|
||||
let fileVersion = version === SWAGGER_VERSION ?
|
||||
rootWithParsedContent.parsed.oasObject.swagger :
|
||||
rootWithParsedContent.parsed.oasObject.openapi;
|
||||
return compareVersion(version, fileVersion);
|
||||
}),
|
||||
data = toBundle ?
|
||||
this.getBundledFileData(parsedRootFiles, inputData, origin, bundleFormat) :
|
||||
this.getBundledFileData(parsedRootFiles, inputData, origin, bundleFormat, version) :
|
||||
this.getRelatedFilesData(parsedRootFiles, inputData, origin);
|
||||
return data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user