-
-
Notifications
You must be signed in to change notification settings - Fork 549
Use [JsonStringEnumMemberName] instead of [EnumMember] #1864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
System.Text.Json ignores the `System.Runtime.Serialization.EnumMember` attribute. It needs the [`System.Text.Json.Serialization.JsonStringEnumMemberName` attribute](https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/customize-properties#custom-enum-member-names) to customize the names of individual enum members.
|
I should have seen it with the new verified files introduced in #1863 but I got fooled by the code compiling properly. Of course compiling doesn't mean working as expected! 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks again!
Apply the equivalent of RicoSuter/NJsonSchema#1863 and RicoSuter/NJsonSchema#1864 while waiting for the next version of NJsonSchema.CodeGeneration.CSharp to be released.
Apply the equivalent of RicoSuter/NJsonSchema#1863 and RicoSuter/NJsonSchema#1864 while waiting for the next version of NJsonSchema.CodeGeneration.CSharp to be released.
Apply the equivalent of RicoSuter/NJsonSchema#1863 and RicoSuter/NJsonSchema#1864 while waiting for the next version of NJsonSchema.CodeGeneration.CSharp to be released.
Apply the equivalent of RicoSuter/NJsonSchema#1863 and RicoSuter/NJsonSchema#1864 while waiting for the next version of NJsonSchema.CodeGeneration.CSharp to be released.
|
Both libraries have now been released as NuGet packages. |
We need to fix this ASAP, this is really bad... TBH i dont even understand what this new attribute is providing in additional value, you could already change name with the previous attriubute, or not?
|
System.Text.Json ignores the
System.Runtime.Serialization.EnumMemberattribute. It needs theSystem.Text.Json.Serialization.JsonStringEnumMemberNameattribute to customize the names of individual enum members.