-
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
During Json Serialization of a 2d array, JsonIgnore attribute not being checked before data type support validation #61205
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json Issue DetailsDescriptionI updated my machine with .Net (6.0.100-rc.2.21505.57). While testing various parts of my Blazor WebAssembly App, I started getting a System.NotSupportedException from a WebAPI call. An exception was being thrown trying to JsonSerialize a class with a double[,] property that had the [JsonIgnore] attribute. Reproduction StepsHere is a minimal API version of an app that exhibits the issue:
Expected behaviorThe expectation is that the JsonSerializer would check for a JsonIgnore attribute before performing any other property validation checks. Actual behaviorThe JsonSerializer does not check for a JsonIgnore attribute before determining if the data type is supported. Regression?I don't recall which version of .Net6 I had been testing before I updated, but it was more than likely the public version prior to 6.0.100-rc.2.21505.57. Known WorkaroundsThe workaround I used, was to drop back to the early days of Getter and Setter methods instead of using a property. Configuration.Net OS Version Browser Editor Other informationNo response
|
Correct, the change was only made in GA. You can get the fix if you'd like by pulling the latest System.Text.Json package from https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet6%40Local&package=System.Text.Json&protocolType=NuGet&version=6.0.0-rtm.21518.12 or wait for the GA release. |
The RTM version looks good. Thank you both for the quick response! |
Description
I updated my machine with .Net (6.0.100-rc.2.21505.57). While testing various parts of my Blazor WebAssembly App, I started getting a System.NotSupportedException from a WebAPI call. An exception was being thrown trying to JsonSerialize a class with a double[,] property that had the [JsonIgnore] attribute.
Reproduction Steps
Here is a minimal API version of an app that exhibits the issue:
Expected behavior
The expectation is that the JsonSerializer would check for a JsonIgnore attribute before performing any other property validation checks.
Actual behavior
The JsonSerializer does not check for a JsonIgnore attribute before determining if the data type is supported.
Regression?
I don't recall which version of .Net6 I had been testing before I updated, but it was more than likely the public version prior to 6.0.100-rc.2.21505.57.
Known Workarounds
The workaround I used, was to drop back to the early days of Getter and Setter methods instead of using a property.
Configuration
.Net
Blazor WebAssembly Application using .Net 6.0.100-rc.2.21505.57
OS Version
Windows 10 Pro x64, Version 21H1, OS build 19043.1237 with Windows Feature Experience Pack 120.2212.3530.
Browser
Microsoft Edge
Version 95.0.1020.40 (Official build) (64-bit)
Editor
Microsoft Visual Studio Community 2022 Preview (64-bit)
Version 17.0.0 Preview 7.0
Other information
No response
The text was updated successfully, but these errors were encountered: