Skip to content

Commit

Permalink
fix: Fixed property names that starts from digit.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed May 27, 2024
1 parent 61c495f commit 768ea56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</ItemGroup>

<PropertyGroup Label="Versioning">
<Version>0.8.2</Version>
<Version>0.8.3</Version>
<MinVerMinimumMajorMinor>0.1</MinVerMinimumMajorMinor>
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerDefaultPreReleaseIdentifiers>dev</MinVerDefaultPreReleaseIdentifiers>
Expand Down
5 changes: 5 additions & 0 deletions src/libs/OpenApiGenerator.Core/Models/PropertyData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public static PropertyData FromSchema(
{
name = name.FixPropertyName(parents.Last().ClassName);
}
if (name.Length > 0 &&
char.IsDigit(name[0]))
{
name = "_" + name;
}

return new PropertyData(
Id: schema.Key,
Expand Down

0 comments on commit 768ea56

Please sign in to comment.