Skip to content
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

Support System.Text.Json JsonStringEnumMemberNameAttribute #1738

Open
bdovaz opened this issue Oct 25, 2024 · 0 comments
Open

Support System.Text.Json JsonStringEnumMemberNameAttribute #1738

bdovaz opened this issue Oct 25, 2024 · 0 comments

Comments

@bdovaz
Copy link

bdovaz commented Oct 25, 2024

Added in 9.0.0: dotnet/runtime#74385

I think it should only affect:

[System.Runtime.Serialization.EnumMember(Value = @"{{ enum.Value | replace: '"', '""' }}")]

And maybe?

var enumMemberAttribute = contextualType.Type.GetRuntimeField(enumName)?.GetCustomAttribute<EnumMemberAttribute>();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant