From 7caaa32624eacfec5134eb724ee0c3be7d1f5f2e Mon Sep 17 00:00:00 2001 From: Samwel K <40166690+samwelkanda@users.noreply.github.com> Date: Thu, 26 Oct 2023 15:32:36 +0300 Subject: [PATCH] Update src/Kiota.Builder/Extensions/OpenApiDeprecationExtensionExtensions.cs Co-authored-by: Vincent Biret --- .../Extensions/OpenApiDeprecationExtensionExtensions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Extensions/OpenApiDeprecationExtensionExtensions.cs b/src/Kiota.Builder/Extensions/OpenApiDeprecationExtensionExtensions.cs index df4f4a0fd2..d3e5bd15f8 100644 --- a/src/Kiota.Builder/Extensions/OpenApiDeprecationExtensionExtensions.cs +++ b/src/Kiota.Builder/Extensions/OpenApiDeprecationExtensionExtensions.cs @@ -35,7 +35,8 @@ internal static DeprecationInformation GetDeprecationInformation(this OpenApiOpe else if (operation.Responses.Values .SelectMany(static x => x.Content.Values) .Select(static x => x?.Schema) - .Where(static x => x != null && !x.IsReferencedSchema()) + .OfType() + .Where(static x => !x.IsReferencedSchema()) .Select(static x => x!.GetDeprecationInformation()) .FirstOrDefault(static x => x.IsDeprecated) is DeprecationInformation responseDeprecationInformation) return responseDeprecationInformation;