Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_.each(documentMetadata.original[modelDefsProp][modelId].allOf, function (schema, index) {
var isInline = false;
var parentPath;
if (_.isUndefined(schema.$ref) || isRemotePtr(JsonRefs.getRefDetails(schema))) {
isInline = true;
parentPath = modelDefPath.concat(['allOf', index.toString()]);
} else {
parentPath = JsonRefs.pathFromPtr(schema.$ref);
}
// If the parent model does not exist, do not create its metadata
if (!_.isUndefined(traverse(documentMetadata.resolved).get(parentPath))) {
// Create metadata for parent
getDefinitionMetadata(parentPath, isInline);
modelMetadata.parents.push(JsonRefs.pathToPtr(parentPath));
}
});