Skip to content

Commit

Permalink
Add NET9. Evaluate JsonStringEnumMemberNameAttribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Jan 4, 2025
1 parent e376d13 commit 6563858
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/KubeOps.Transpiler/Crds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@ private static IList<object> GetEnumNames(this MetadataLoadContext context, Type
{
attributeNameByFieldName.Add(field.Name, enumMemberAtribute.Value);
}
#if NET9_0_OR_GREATER
if (field.GetCustomAttribute<JsonStringEnumMemberNameAttribute>() is { Name: not null } jsonMemberNameAtribute)
{
attributeNameByFieldName.Add(field.Name, jsonMemberNameAtribute.Name);
}
#endif
}

var enumName = new List<object>();
Expand Down
2 changes: 1 addition & 1 deletion src/KubeOps.Transpiler/KubeOps.Transpiler.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 6563858

Please sign in to comment.