-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Improve error output for unsupported scenarios in System.Text.Json.Serialization #29492
Comments
Another case: when there is no default constructor defined for a class NRE is throwing public class PublicParameterizedConstructorTestClass
{
private readonly string _name;
public PublicParameterizedConstructorTestClass(string name)
{
_name = name;
}
public string Name
{
get { return _name; }
}
}
[Fact]
public void TestNoDefaultConstuctor() {
string json = @"{""Name"":""Name!""}";
Assert.Throws<JsonException>(() =>JsonSerializer.Parse<PublicParameterizedConstructorTestClass>(json));
} |
@steveharter @ahsonkhan is this up for grabs or there is someone working on? |
It's up for grabs. Marking accordingly. |
Link another related issue https://github.com/dotnet/corefx/issues/37188 |
@MarcoRossignoli are you working on it ? |
I worked on some of these here dotnet/corefx#38061 |
I recommend closing this. We should have separate issues for any remaining issues. |
Closing. Please create new issues for any remaining issues. |
S.T.J.Serialization is expected to have a few unsupported scenarios, however this is currently difficult for the developer to diagnose because the error output for such scenarios is usually something along these lines:
As suggested in https://github.com/dotnet/corefx/issues/37522#issuecomment-490916117, this issue is to track improvement of error messages when encountered by the new serialization APIs.
The text was updated successfully, but these errors were encountered: