Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
shouldSetAdditionalPropertiesFalse: false,
shouldResolvePureObjects: false
}
this.specResolver = new SpecResolver(
this.specPath,
this.specInJson,
specOptions,
jsonParser.defaultErrorReport
)
await this.specResolver.resolve(suppression)
await this.resolveExamples(suppression)
const options = {
definition: this.specInJson,
jsonRefs: { relativeBase: this.specDir }
}
const api = await Sway.create(options)
this.swaggerApi = api
return api
} catch (err) {
const e = this.constructErrorObject(ErrorCodes.ResolveSpecError, err.message, [err])
// self.specValidationResult.resolveSpec = e;
log.error(`${ErrorCodes.ResolveSpecError.name}: ${err.message}.`)
log.error(err.stack)
throw e
}
}
const resolver = new specResolver.SpecResolver(
this.specPath,
this.specInJson,
this.options,
reportError,
this.docsCache
)
this.specInJson = (await resolver.resolve(suppression)).specInJson
const options = {
definition: this.specInJson,
jsonRefs: {
relativeBase: this.specDir
},
isPathCaseSensitive: this.options.isPathCaseSensitive
}
this.swaggerApi = await Sway.create(options)
} catch (err) {
const e = this.constructErrorObject({
code: ErrorCodes.InternalError,
message: err.message,
innerErrors: [err]
})
this.specValidationResult.resolveSpec = e
log.error(`${ErrorCodes.ResolveSpecError.name}: ${err.message}.`)
log.error(err.stack)
throw e
}
if (errors.length > 0) {
const err = errors[0]
const e = this.constructErrorObject({
code: ErrorCodes.JsonParsingError,
message: err.message,