add multiple versions support

add multiple versions support
This commit is contained in:
Luis Tejeda
2022-04-19 16:41:21 -05:00
committed by Erik Mendoza
parent 36e83721dd
commit 30cc74b720
7 changed files with 342 additions and 28 deletions

View File

@@ -52,9 +52,13 @@ class SchemaPack {
this.computedOptions.schemaFaker = true;
let indentCharacter = this.computedOptions.indentCharacter;
this.computedOptions.indentCharacter = indentCharacter === 'tab' ? '\t' : ' ';
concreteUtils = getConcreteSchemaUtils(input);
this.hasDefinedVersion = concreteUtils !== undefined;
try {
this.hasDefinedVersion = true;
concreteUtils = getConcreteSchemaUtils(input);
}
catch (error) {
this.hasDefinedVersion = false;
}
this.validate();
}
@@ -631,7 +635,8 @@ class SchemaPack {
});
}
adaptedInput = schemaUtils.mapDetectRootFilesInputToGetRootFilesInput(input);
rootFiles = parse.getRootFiles(adaptedInput, concreteUtils.inputValidation, this.computedOptions, files);
rootFiles = parse.getRootFiles(adaptedInput, concreteUtils.inputValidation, this.computedOptions, files,
input.specificationVersion);
res = schemaUtils.mapGetRootFilesOutputToDetectRootFilesOutput(rootFiles, input.specificationVersion);
return res;
}