Skip to content

Commit

Permalink
Create anoymous types with camel casing (#1716)
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangHG authored Jan 9, 2025
1 parent 6b85e07 commit 8f09e8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/NJsonSchema/DefaultTypeNameGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ private string GenerateAnonymousTypeName(string typeNameHint, IEnumerable<string
}

var count = 1;
string typeName;
do
{
count++;
} while (reservedTypeNames.Contains(typeNameHint + count));
typeName = ConversionUtilities.ConvertToUpperCamelCase(typeNameHint + count, true);
} while (reservedTypeNames.Contains(typeName));

return typeNameHint + count;
return typeName;
}

return GenerateAnonymousTypeName("Anonymous", reservedTypeNames);
Expand Down

0 comments on commit 8f09e8c

Please sign in to comment.