diff --git a/lib/spec.js b/lib/spec.js index 9a2de0b..b249ee3 100644 --- a/lib/spec.js +++ b/lib/spec.js @@ -805,11 +805,11 @@ export default class Spec { path = '#'; } try { - const schema = await $RefParser.dereference(filename); + const schemaRelativePath = this.suite.resolveFile(filename); + const schema = await $RefParser.dereference(schemaRelativePath); const $refs = await $RefParser.resolve(schema); expectedSchema = $refs.get(path); } catch (e) { - console.error(e); throw new ResponseJSONSchemaValidationError(`${e.name} occurred while parsing the input schema in '${jsonSchemaInfo['$ref']}' \n ${e.message}`); } } else {