fix resolving directory of relative swagger references
This commit is contained in:
Родитель
bc93b145bb
Коммит
62045cc896
|
@ -167,11 +167,12 @@ class SpecResolver {
|
|||
let slicedRefName = refName.slice(1);
|
||||
let reference = node['$ref'];
|
||||
let parsedReference = utils.parseReferenceInSwagger(reference);
|
||||
let docDir = path.dirname(docPath);
|
||||
|
||||
if (parsedReference.filePath) {
|
||||
//assuming that everything in the spec is relative to it, let us join the spec directory
|
||||
//and the file path in reference.
|
||||
docPath = utils.joinPath(self.specDir, parsedReference.filePath);
|
||||
docPath = utils.joinPath(docDir, parsedReference.filePath);
|
||||
}
|
||||
|
||||
return utils.parseJson(docPath).then(function (result) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче