diff --git a/src/Microsoft.OpenApi/Reader/OpenApiDiagnostic.cs b/src/Microsoft.OpenApi/Reader/OpenApiDiagnostic.cs index 9f09bb457..5340d2aef 100644 --- a/src/Microsoft.OpenApi/Reader/OpenApiDiagnostic.cs +++ b/src/Microsoft.OpenApi/Reader/OpenApiDiagnostic.cs @@ -48,26 +48,26 @@ public void AppendDiagnostic(OpenApiDiagnostic diagnosticToAdd, string fileNameT } } } -} -/// -/// Extension class for IList to add the Method "AddRange" used above -/// -public static class IDiagnosticExtensions -{ /// - /// Extension method for IList so that another list can be added to the current list. + /// Extension class for IList to add the Method "AddRange" used above /// - /// - /// - /// - public static void AddRange(this ICollection collection, IEnumerable enumerable) + internal static class IDiagnosticExtensions { - if (collection is null || enumerable is null) return; - - foreach (var cur in enumerable) + /// + /// Extension method for IList so that another list can be added to the current list. + /// + /// + /// + /// + public static void AddRange(this ICollection collection, IEnumerable enumerable) { - collection.Add(cur); + if (collection is null || enumerable is null) return; + + foreach (var cur in enumerable) + { + collection.Add(cur); + } } } } diff --git a/test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt b/test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt index 3143b28b6..beae10400 100644 --- a/test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt +++ b/test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt @@ -2,10 +2,6 @@ [assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Microsoft.OpenApi.Readers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Microsoft.OpenApi.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100957cb48387b2a5f54f5ce39255f18f26d32a39990db27cf48737afc6bc62759ba996b8a2bfb675d4e39f3d06ecb55a178b1b4031dcb2a767e29977d88cce864a0d16bfc1b3bebb0edf9fe285f10fffc0a85f93d664fa05af07faa3aad2e545182dbf787e3fd32b56aca95df1a3c4e75dec164a3f1a4c653d971b01ffc39eb3c4")] [assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")] -public static class IDiagnosticExtensions -{ - public static void AddRange(this System.Collections.Generic.ICollection collection, System.Collections.Generic.IEnumerable enumerable) { } -} namespace Microsoft.OpenApi.Any { public class OpenApiAny : Microsoft.OpenApi.Interfaces.IOpenApiElement, Microsoft.OpenApi.Interfaces.IOpenApiExtension