diff --git a/src/KubeOps.Transpiler/Crds.cs b/src/KubeOps.Transpiler/Crds.cs index a188675f..40b924f7 100644 --- a/src/KubeOps.Transpiler/Crds.cs +++ b/src/KubeOps.Transpiler/Crds.cs @@ -352,6 +352,12 @@ private static IList GetEnumNames(this MetadataLoadContext context, Type { attributeNameByFieldName.Add(field.Name, enumMemberAtribute.Value); } +#if NET9_0_OR_GREATER + if (field.GetCustomAttribute() is { Name: not null } jsonMemberNameAtribute) + { + attributeNameByFieldName.Add(field.Name, jsonMemberNameAtribute.Name); + } +#endif } var enumName = new List(); diff --git a/src/KubeOps.Transpiler/KubeOps.Transpiler.csproj b/src/KubeOps.Transpiler/KubeOps.Transpiler.csproj index a71a5557..25af1db5 100644 --- a/src/KubeOps.Transpiler/KubeOps.Transpiler.csproj +++ b/src/KubeOps.Transpiler/KubeOps.Transpiler.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0