mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Add input validation for Multifile APIs
Add input validation for Multifile APIs
This commit is contained in:
@@ -629,14 +629,11 @@ class SchemaPack {
|
||||
*/
|
||||
async detectRootFiles() {
|
||||
const input = this.input;
|
||||
if (input.data[0].path === '') {
|
||||
throw new Error('undefined input');
|
||||
}
|
||||
|
||||
schemaUtils.validateInputMultiFileAPI(input);
|
||||
if (!this.hasDefinedVersion && ('content' in input.data[0])) {
|
||||
return schemaUtils.mapGetRootFilesOutputToDetectRootFilesOutput([], input.specificationVersion);
|
||||
}
|
||||
|
||||
let files = {},
|
||||
rootFiles,
|
||||
res,
|
||||
@@ -668,6 +665,8 @@ class SchemaPack {
|
||||
*/
|
||||
async detectRelatedFiles() {
|
||||
const input = this.input;
|
||||
|
||||
schemaUtils.validateInputMultiFileAPI(input);
|
||||
if (!input.rootFiles || input.rootFiles.length === 0) {
|
||||
let rootFiles = await this.detectRootFiles(input);
|
||||
if (rootFiles.output.data) {
|
||||
@@ -698,6 +697,8 @@ class SchemaPack {
|
||||
*/
|
||||
async bundle() {
|
||||
const input = this.input;
|
||||
|
||||
schemaUtils.validateInputMultiFileAPI(input);
|
||||
if (!input.rootFiles || input.rootFiles.length === 0) {
|
||||
let rootFiles = await this.detectRootFiles(input);
|
||||
if (rootFiles.output.data) {
|
||||
|
||||
Reference in New Issue
Block a user