Skipped optimization based stacklimit configuration for validation as default is true

This commit is contained in:
Vishal Shingala
2022-02-16 18:16:25 +05:30
parent 6340bde613
commit bd7ce342c2

View File

@@ -373,7 +373,6 @@ class SchemaPack {
validateTransaction(transactions, callback) { validateTransaction(transactions, callback) {
let schema = this.openapi, let schema = this.openapi,
componentsAndPaths, componentsAndPaths,
analysis,
options = this.computedOptions, options = this.computedOptions,
schemaCache = { schemaCache = {
schemaResolutionCache: this.schemaResolutionCache, schemaResolutionCache: this.schemaResolutionCache,
@@ -382,15 +381,6 @@ class SchemaPack {
matchedEndpoints = [], matchedEndpoints = [],
jsonSchemaDialect = schema.jsonSchemaDialect; jsonSchemaDialect = schema.jsonSchemaDialect;
// Only change the stack limit if the optimizeConversion option is true
if (options.optimizeConversion) {
// Deciding stack limit based on size of the schema, number of refs and number of paths.
analysis = schemaUtils.analyzeSpec(schema);
// Update options on the basis of analysis.
options = schemaUtils.determineOptions(analysis, options);
}
if (!this.validated) { if (!this.validated) {
return callback(new OpenApiErr('The schema must be validated before attempting conversion')); return callback(new OpenApiErr('The schema must be validated before attempting conversion'));
} }