/// <summary>
 /// Resolve all references to SecuritySchemes
 /// </summary>
 public override void Visit(OpenApiSecurityRequirement securityRequirement)
 {
     foreach (var scheme in securityRequirement.Keys.ToList())
     {
         ResolveObject(scheme, (resolvedScheme) => {
             // If scheme was unresolved
             // copy Scopes and remove old unresolved scheme
             var scopes = securityRequirement[scheme];
             securityRequirement.Remove(scheme);
             securityRequirement.Add(resolvedScheme, scopes);
         });
     }
 }
        public ChangedSecurityRequirementBO Diff(
            OpenApiSecurityRequirement left, OpenApiSecurityRequirement right, DiffContextBO context)
        {
            var changedSecurityRequirement =
                new ChangedSecurityRequirementBO(left, right != null ? GetCopy(right) : null);

            left ??= new OpenApiSecurityRequirement();
            right ??= new OpenApiSecurityRequirement();

            foreach (var(key, value) in left)
            {
                var rightSec = Contains(right, key.Reference?.ReferenceV3);
                if (rightSec.IsNullOrEmpty())
                {
                    changedSecurityRequirement.Missing.Add(key, value);
                }
                else
                {
                    var rightSchemeRef = rightSec.Keys.First();
                    right.Remove(rightSchemeRef);
                    var diff =
                        _openApiDiff
                        .SecuritySchemeDiff
                        .Diff(
                            key.Reference?.ReferenceV3,
                            value.ToList(),
                            rightSchemeRef.Reference?.ReferenceV3,
                            rightSec[rightSchemeRef].ToList(),
                            context);
                    if (diff != null)
                    {
                        changedSecurityRequirement.Changed.Add(diff);
                    }
                }
            }

            foreach (var(key, value) in right)
            {
                changedSecurityRequirement.Increased.Add(key, value);
            }

            return(ChangedUtils.IsChanged(changedSecurityRequirement));
        }