From 8b182635ba6fbe6a68ed0e23e39c039ad9ec5af7 Mon Sep 17 00:00:00 2001 From: HavenDV Date: Sat, 21 Sep 2024 17:14:55 +0400 Subject: [PATCH] fix: Fixed issue with empty smart names for named AnyOfs. --- src/libs/AutoSDK/Models/AnyOfData.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/AutoSDK/Models/AnyOfData.cs b/src/libs/AutoSDK/Models/AnyOfData.cs index 90e1a6da61..9c3bb40712 100644 --- a/src/libs/AutoSDK/Models/AnyOfData.cs +++ b/src/libs/AutoSDK/Models/AnyOfData.cs @@ -28,8 +28,12 @@ public static AnyOfData FromSchemaContext(SchemaContext context) ? Hint.OneOf : Hint.AllOf)) .ToList(); - var useSmartNames = children.All(x => x.Schema.Reference != null); var className = context.Id.ToClassName(); + var useSmartNames = children.All(x => + x.Schema.Reference != null && + !string.IsNullOrWhiteSpace(SmartNamedAnyOfNames.ComputeSmartName( + (x.TypeData ?? TypeData.Default).ShortCSharpTypeWithoutNullability, + className))); return new AnyOfData( SubType: context.IsAnyOf