diff --git a/src/libs/Firecrawl/Generated/Firecrawl.AllOf.2.g.cs b/src/libs/Firecrawl/Generated/Firecrawl.AllOf.2.g.cs index b82f968..6c768bc 100644 --- a/src/libs/Firecrawl/Generated/Firecrawl.AllOf.2.g.cs +++ b/src/libs/Firecrawl/Generated/Firecrawl.AllOf.2.g.cs @@ -105,12 +105,51 @@ Value1 as object Value2?.ToString() ; + private static bool RequiresValue() => RequirementCache.Value; + + private static bool DetermineRequiresValue(global::System.Type type) + { + if (global::System.Nullable.GetUnderlyingType(type) != null) + { + return false; + } + + if (type.IsValueType || + type == typeof(string) || + type.IsArray) + { + return true; + } + + foreach (var property in type.GetProperties(global::System.Reflection.BindingFlags.Instance | global::System.Reflection.BindingFlags.Public)) + { + foreach (var attributeData in property.CustomAttributes) + { + var attributeTypeName = attributeData.AttributeType.FullName; + if (attributeTypeName == "System.Text.Json.Serialization.JsonRequiredAttribute" || + attributeTypeName == "Newtonsoft.Json.JsonRequiredAttribute" || + attributeTypeName == "System.Runtime.CompilerServices.RequiredMemberAttribute") + { + return true; + } + } + } + + return false; + } + + private static class RequirementCache + { + public static readonly bool Value = DetermineRequiresValue(typeof(TValue)); + } + + /// /// /// public bool Validate() { - return IsValue1 && IsValue2; + return (!RequiresValue() || IsValue1) && (!RequiresValue() || IsValue2); } ///