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

Implement JsonStringEnumConverter<TEnum> #87224

Merged

Conversation

eiriktsarpalis
Copy link
Member

Supersedes #87149. Fixes #79311.

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost assigned eiriktsarpalis Jun 7, 2023
@ghost
Copy link

ghost commented Jun 7, 2023

Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.

Issue Details

Supersedes #87149. Fixes #79311.

Author: eiriktsarpalis
Assignees: -
Labels:

area-System.Text.Json, new-api-needs-documentation

Milestone: -

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great work here @eiriktsarpalis!

@eiriktsarpalis eiriktsarpalis merged commit 9d7840c into dotnet:main Jun 7, 2023
@eiriktsarpalis eiriktsarpalis deleted the fix/aot-stringenumconverter branch June 7, 2023 23:20
eerhardt added a commit to dotnet/aspnetcore that referenced this pull request Jun 8, 2023
…rce generator warning.

InteractionType is used in a JsonSerializerContext. With dotnet/runtime#87224, there is now a warning to convert source generated usages of JsonStringEnumConverter to JsonStringEnumConverter<TEnum>.

I went ahead and updated the other 2 usages as well, to make them consistent.
dotnet-maestro bot added a commit to dotnet/aspnetcore that referenced this pull request Jun 8, 2023
[main] Update dependencies from dotnet/efcore dotnet/runtime


 - Fix Http Results test to respond to dotnet/runtime#87093

 - Convert to new generic JsonStringEnumConverter<TEnum> to fix JSON source generator warning.

InteractionType is used in a JsonSerializerContext. With dotnet/runtime#87224, there is now a warning to convert source generated usages of JsonStringEnumConverter to JsonStringEnumConverter<TEnum>.

I went ahead and updated the other 2 usages as well, to make them consistent.

 - Skip AcceptAsync_NoCertificateCallback_RemovedFromPendingConnections

See #48678
@ghost ghost locked as resolved and limited conversation to collaborators Jul 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide trim/AOT-safe mechanism to (de)serialize enums from strings with JSON source-gen
3 participants