NJsonSchema
NJsonSchema copied to clipboard
Infinite loop in RenamePropertyWithSameNameAsClass
Hello, I've discovered an infinite loop in the CSharpGenerator.RenamePropertyWithSameNameAsClass
method. The problem arises when a property shares the same name as its enclosing type and another property already bears a '1' suffix:
var number = 1;
var candidate = typeName + number;
while (propertyModels.Any(p => p.PropertyName == candidate))
{
number++;
}
This loop will persist indefinitely under the described condition.