/// <summary>
        /// Adds an open api difference.
        /// </summary>
        /// <param name="openApiDifference">The open api difference to add.</param>
        public void AddOpenApiDifference(OpenApiDifference openApiDifference)
        {
            if (openApiDifference == null)
            {
                throw Error.ArgumentNull(nameof(openApiDifference));
            }

            _openApiDifferences.Add(openApiDifference);
        }
 /// <summary>
 /// Adds a segment to the context path to enable pointing to the current location in the document.
 /// </summary>
 /// <param name="comparisonContext">The context under which to compare the objects.</param>
 /// <param name="segment">An identifier for the segment.</param>
 /// <param name="openApiDifference">The open api difference to add.</param>
 internal void WalkAndAddOpenApiDifference(
     ComparisonContext comparisonContext,
     string segment,
     OpenApiDifference openApiDifference)
 {
     comparisonContext.Enter(segment.Replace("~", "~0").Replace("/", "~1"));
     openApiDifference.Pointer = comparisonContext.PathString;
     comparisonContext.AddOpenApiDifference(openApiDifference);
     comparisonContext.Exit();
 }