diff --git a/src/Microsoft.OpenApi.Readers/ParseNodes/OpenApiAnyConverter.cs b/src/Microsoft.OpenApi.Readers/ParseNodes/OpenApiAnyConverter.cs index 68936c602..e104365c1 100644 --- a/src/Microsoft.OpenApi.Readers/ParseNodes/OpenApiAnyConverter.cs +++ b/src/Microsoft.OpenApi.Readers/ParseNodes/OpenApiAnyConverter.cs @@ -50,7 +50,7 @@ public static IOpenApiAny GetSpecificOpenApiAny(IOpenApiAny openApiAny, OpenApiS return newObject; } - if (!(openApiAny is OpenApiString apiString)) + if (openApiAny is not OpenApiString apiString) { return openApiAny; } diff --git a/src/Microsoft.OpenApi/Validations/Rules/RuleHelpers.cs b/src/Microsoft.OpenApi/Validations/Rules/RuleHelpers.cs index 1613da17f..dc4b6d6c9 100644 --- a/src/Microsoft.OpenApi/Validations/Rules/RuleHelpers.cs +++ b/src/Microsoft.OpenApi/Validations/Rules/RuleHelpers.cs @@ -75,7 +75,7 @@ public static void ValidateDataTypeMismatch( } // If value is not a string and also not an object, there is a data mismatch. - if (!(value is OpenApiObject anyObject)) + if (value is not OpenApiObject anyObject) { context.CreateWarning( ruleName, @@ -113,7 +113,7 @@ public static void ValidateDataTypeMismatch( } // If value is not a string and also not an array, there is a data mismatch. - if (!(value is OpenApiArray anyArray)) + if (value is not OpenApiArray anyArray) { context.CreateWarning( ruleName,