mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Add dfs algorithm
Add dfs algorithm
This commit is contained in:
committed by
Erik Mendoza
parent
0b03a26d1c
commit
2fefe62dc1
@@ -87,7 +87,8 @@ const { formatDataPath, checkIsCorrectType, isKnownType,
|
||||
],
|
||||
|
||||
crypto = require('crypto'),
|
||||
DEFAULT_SCHEMA_UTILS = require('./30XUtils/schemaUtils30X');
|
||||
DEFAULT_SCHEMA_UTILS = require('./30XUtils/schemaUtils30X'),
|
||||
{ getRelatedFiles } = require('./relatedFiles');
|
||||
/* eslint-enable */
|
||||
|
||||
// See https://github.com/json-schema-faker/json-schema-faker/tree/master/docs#available-options
|
||||
@@ -4842,6 +4843,35 @@ module.exports = {
|
||||
data: adaptedData
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
mapRootFiles(rootFiles) {
|
||||
let data = rootFiles.map((root) => {
|
||||
let relatedFiles = getRelatedFiles();
|
||||
return { rootFile: { path: root.path }, relatedFiles: relatedFiles };
|
||||
});
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
processRelatedFiles(inputRelatedFiles) {
|
||||
let version = inputRelatedFiles.specificationVersion ? inputRelatedFiles.specificationVersion : '3.0.0',
|
||||
res = {
|
||||
result: true,
|
||||
output: {
|
||||
type: 'relatedFiles',
|
||||
specification: {
|
||||
type: 'OpenAPI',
|
||||
version: version
|
||||
},
|
||||
data: [
|
||||
]
|
||||
}
|
||||
};
|
||||
if (inputRelatedFiles.rootFiles && inputRelatedFiles.rootFiles.length > 0) {
|
||||
res.output.data = this.mapRootFiles(inputRelatedFiles.rootFiles, version);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user