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

Add a JsonConverter.Type property. #87382

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

eiriktsarpalis
Copy link
Member

Fix #63898.

@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.

@eiriktsarpalis eiriktsarpalis self-assigned this Jun 11, 2023
@eiriktsarpalis eiriktsarpalis added this to the 8.0.0 milestone Jun 11, 2023
@ghost
Copy link

ghost commented Jun 11, 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

Fix #63898.

Author: eiriktsarpalis
Assignees: -
Labels:

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

Milestone: -

@@ -199,6 +199,7 @@ public partial struct JsonReaderState
}
public static partial class JsonSerializer
{
public static bool IsReflectionEnabledByDefault { get { throw null; } }
Copy link
Member Author

Choose a reason for hiding this comment

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

A few unrelated reorderings caused by running the generation tool.

Assert.Equal("{}", json);

Assert.Throws<NotSupportedException>(() => JsonSerializer.Deserialize<JsonConverter>(json, PublicContext.Default.Options));
Assert.Throws<NotSupportedException>(() => JsonSerializer.Serialize(obj, PublicContext.Default.Options));
Copy link
Member Author

Choose a reason for hiding this comment

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

Attempting to serialize a JsonConverter will now throw since it carries an unsupported property of type Type. I think that's ok since it's not a particularly meaningful scenario.

Copy link
Contributor

@layomia layomia left a comment

Choose a reason for hiding this comment

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

LGTM.

@eiriktsarpalis eiriktsarpalis merged commit 52bacbc into dotnet:main Jun 12, 2023
@eiriktsarpalis eiriktsarpalis deleted the add/jsonconverter-type branch June 12, 2023 18:55
@ghost ghost locked as resolved and limited conversation to collaborators Jul 13, 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.

Add a JsonConverter.Type property.
3 participants