Added support for internal $ref resolution in validation flows

This commit is contained in:
Vishal Shingala
2020-09-01 17:55:51 +05:30
parent 55ee719a23
commit 1215d9de15
5 changed files with 427 additions and 1 deletions

View File

@@ -447,6 +447,14 @@ class SchemaPack {
pathVar.value = _.get(mappedPathVar, 'value', pathVar.value);
});
// resolve $ref in all parameter objects if present
_.forEach(_.get(matchedPath, 'path.parameters'), (param) => {
if (param.hasOwnProperty('$ref')) {
_.assign(param, schemaUtils.getRefObject(param.$ref, componentsAndPaths, options));
_.unset(param, '$ref');
}
});
matchedEndpoints.push(matchedPath.jsonPath);
// 3. validation involves checking these individual properties
async.parallel({