function handleCircularReference(traverseContext, documentContext) {
  let relatedRef = '';
  if (traverseContext.circular) {
    relatedRef = findReferenceByMainKeyInTraceFromContext(documentContext, traverseContext.circular.key);
    traverseContext.update({ $ref: relatedRef });
  }
  if (traverseContext.keys && traverseContext.keys.includes(CIRCULAR_OR_REF_EXT_PROP)) {
    traverseContext.update({ $ref: traverseContext.node[CIRCULAR_OR_REF_EXT_PROP] });
  }
}
Modifies content of a node if it is circular reference.

@param {function} traverseContext - The context of the traverse function
@param {object} documentContext The document context from root
@returns {undefined}  nothing