Skip to content

Commit

Permalink
fix: Fixed issue with empty smart names for named AnyOfs.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 21, 2024
1 parent 5209055 commit 8b18263
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libs/AutoSDK/Models/AnyOfData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b18263

Please sign in to comment.