11// Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the MIT license.
33
4- using System . Linq ;
5- using Microsoft . OpenApi . Any ;
64using Microsoft . OpenApi . Models ;
75
86namespace Microsoft . AspNetCore . OpenApi ;
@@ -31,22 +29,22 @@ public bool Equals(OpenApiSchema? x, OpenApiSchema? y)
3129 x . Type == y . Type &&
3230 x . Format == y . Format &&
3331 SchemaIdEquals ( x , y ) &&
34- x . Properties . Keys . All ( k => y . Properties . TryGetValue ( k , out var yValue ) && Instance . Equals ( x . Properties [ k ] , yValue ) ) &&
32+ ComparerHelpers . DictionaryEquals ( x . Properties , y . Properties , Instance ) &&
3533 OpenApiDiscriminatorComparer . Instance . Equals ( x . Discriminator , y . Discriminator ) &&
3634 Instance . Equals ( x . AdditionalProperties , y . AdditionalProperties ) &&
3735 x . AdditionalPropertiesAllowed == y . AdditionalPropertiesAllowed &&
38- x . AllOf . SequenceEqual ( y . AllOf , Instance ) &&
39- x . AnyOf . SequenceEqual ( y . AnyOf , Instance ) &&
36+ ComparerHelpers . ListEquals ( x . AllOf , y . AllOf , Instance ) &&
37+ ComparerHelpers . ListEquals ( x . AnyOf , y . AnyOf , Instance ) &&
4038 x . Deprecated == y . Deprecated &&
4139 OpenApiAnyComparer . Instance . Equals ( x . Default , y . Default ) &&
4240 x . Description == y . Description &&
4341 OpenApiAnyComparer . Instance . Equals ( x . Example , y . Example ) &&
4442 x . ExclusiveMaximum == y . ExclusiveMaximum &&
4543 x . ExclusiveMinimum == y . ExclusiveMinimum &&
4644 x . Extensions . Count == y . Extensions . Count &&
47- x . Extensions . Keys . All ( k => y . Extensions . TryGetValue ( k , out var yValue ) && x . Extensions [ k ] is IOpenApiAny anyX && yValue is IOpenApiAny anyY && OpenApiAnyComparer . Instance . Equals ( anyX , anyY ) ) &&
45+ ComparerHelpers . DictionaryEquals ( x . Extensions , y . Extensions , OpenApiAnyComparer . Instance ) &&
4846 OpenApiExternalDocsComparer . Instance . Equals ( x . ExternalDocs , y . ExternalDocs ) &&
49- x . Enum . SequenceEqual ( y . Enum , OpenApiAnyComparer . Instance ) &&
47+ ComparerHelpers . ListEquals ( x . Enum , y . Enum , OpenApiAnyComparer . Instance ) &&
5048 Instance . Equals ( x . Items , y . Items ) &&
5149 x . Title == y . Title &&
5250 x . Maximum == y . Maximum &&
@@ -58,7 +56,7 @@ public bool Equals(OpenApiSchema? x, OpenApiSchema? y)
5856 x . MinLength == y . MinLength &&
5957 x . MinProperties == y . MinProperties &&
6058 x . MultipleOf == y . MultipleOf &&
61- x . OneOf . SequenceEqual ( y . OneOf , Instance ) &&
59+ ComparerHelpers . ListEquals ( x . OneOf , y . OneOf , Instance ) &&
6260 Instance . Equals ( x . Not , y . Not ) &&
6361 x . Nullable == y . Nullable &&
6462 x . Pattern == y . Pattern &&
0 commit comments