diff --git a/src/libs/OpenApiGenerator.Core/Models/PropertyData.cs b/src/libs/OpenApiGenerator.Core/Models/PropertyData.cs index 0ef2d9ad02..06328d86e3 100644 --- a/src/libs/OpenApiGenerator.Core/Models/PropertyData.cs +++ b/src/libs/OpenApiGenerator.Core/Models/PropertyData.cs @@ -47,6 +47,12 @@ public static PropertyData FromSchema( .UseWordSeparator('_', '+', '-', '/') .Replace("[", string.Empty) .Replace("]", string.Empty); + + if (name[0] is not ('_' or >= 'A' and <= 'Z' or >= 'a' and <= 'z')) + { + name = $"_{name}"; + } + if (parents.Length != 0) { name = name.FixPropertyName(parents.Last().ClassName);