From 7e1b1ab690ae58868351b8bb2fe8390f13f92c76 Mon Sep 17 00:00:00 2001 From: Ashish Dhingra <67916761+ashishdhingra@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:25:22 -0700 Subject: [PATCH] Fixed AwsResolver.CreateProperties() to use logical OR condition when checking for Amazon.Lambda.CloudWatchEvents.CloudWatchEvent type. --- Libraries/src/Amazon.Lambda.Serialization.Json/AwsResolver.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/src/Amazon.Lambda.Serialization.Json/AwsResolver.cs b/Libraries/src/Amazon.Lambda.Serialization.Json/AwsResolver.cs index 5b528cbf6..056b954db 100644 --- a/Libraries/src/Amazon.Lambda.Serialization.Json/AwsResolver.cs +++ b/Libraries/src/Amazon.Lambda.Serialization.Json/AwsResolver.cs @@ -130,8 +130,9 @@ protected override IList CreateProperties(Type type, MemberSeriali } } } + // If user is directly using CloudWatchEvent class or using a derived type created in custom namespace. else if (type.FullName.StartsWith("Amazon.Lambda.CloudWatchEvents.") - && (type.GetTypeInfo().BaseType?.FullName?.StartsWith("Amazon.Lambda.CloudWatchEvents.CloudWatchEvent`", + || (type.GetTypeInfo().BaseType?.FullName?.StartsWith("Amazon.Lambda.CloudWatchEvents.CloudWatchEvent`", StringComparison.Ordinal) ?? false)) { foreach (JsonProperty property in properties)