diff --git a/lib/classes/YamlParser.js b/lib/classes/YamlParser.js index 161be346c..714eae351 100644 --- a/lib/classes/YamlParser.js +++ b/lib/classes/YamlParser.js @@ -1,6 +1,5 @@ 'use strict'; -const path = require('path'); const YAML = require('js-yaml'); const resolve = require('json-refs').resolveRefs; @@ -10,10 +9,6 @@ class YamlParser { } parse(yamlFilePath) { - let parentDir = yamlFilePath.split(path.sep); - parentDir.pop(); - parentDir = parentDir.join('/'); - const root = this.serverless.utils.readFileSync(yamlFilePath); const options = { filter: ['relative', 'remote'], @@ -22,7 +17,7 @@ class YamlParser { callback(null, YAML.load(res.text)); }, }, - relativeBase: parentDir, + location: yamlFilePath, }; return resolve(root, options).then(res => res.resolved); } diff --git a/package.json b/package.json index 3b66ad355..c4224e1e8 100644 --- a/package.json +++ b/package.json @@ -204,7 +204,7 @@ "is-wsl": "^2.2.0", "js-yaml": "^3.13.1", "json-cycle": "^1.3.0", - "json-refs": "^2.1.7", + "json-refs": "^3.0.15", "jwt-decode": "^2.2.0", "lodash": "^4.17.15", "memoizee": "^0.4.14",