-
Notifications
You must be signed in to change notification settings - Fork 10k
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
[Blazor Webassembly] Give JsonSerializerOptions to HttpClient Make result "empty" #21322
Comments
@julienGrd thanks for contacting us. I don't think this is Blazor webassembly now since @pranavkm do you have any thoughts on this? |
MVC 3.x's output formatter does not support features introduced in System.Text.Json 5.0. This includes the new JsonSerializerOptions()
{
PropertyNameCaseInsensitive = true,
ReferenceHandling = ReferenceHandling.Preserve,
} |
It work by adding the PropertyNameCaseInsensitive property, thanks ! What do you mean by "MVC 3.x's output formatter does not support features introduced in System.Text.Json 5.0" ? Im actually in .net 5 preview in my server, so its OK for me ? There is any way to achieve this (use System.Text.Json completely) or im stuck with NewtonSoft ? Other question : is it possible to use both system on server ? For example use System.Text.Json generally but on some method/controller use newtonsoft ? |
|
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
Hello Guys,
It seem the new System.Text.Json Api can now handle ReferenceLoopHandling as suggest this issue (#21187 (comment)).
So i try implement this in my app to replace Newtonsoft.Json.
I precise i have this version of System.Net.Http.Json : 5.0.0-preview.3.20214.6
I configure my server project to activate this
And my client project
I don't have errors, i retrieve an array with the correct amount of items, but all the properties are empty.
I notice is the same thing with an empty JsonSerializerOptions, so it seem not related to this specific option or to the server project.
To reproduce in the default project, just add an empty option :
Thanks !
The text was updated successfully, but these errors were encountered: