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

Blazor - Add JsonSerializerOptions as parameter to HttpClient.GetJsonAsync<T> #31551

Closed
mkArtakMSFT opened this issue Nov 22, 2019 · 4 comments
Closed
Assignees
Milestone

Comments

@mkArtakMSFT
Copy link
Member

From @GoranHalvarsson on Sunday, June 16, 2019 7:49:28 PM

I suggest you add JsonSerializerOptions as a parameter(could be optional) to the HttpClient.GetJsonAsync method. For the deserialization of json you are using JsonSerializer.Parse<T>(await httpClient.GetStringAsync(requestUri), JsonSerializerOptionsProvider.Options).

The parameter JsonSerializerOptionsProvider.Options should be accessible.

This should probably be added to all extension methods in Microsoft.AspNetCore.Components.HttpClientJsonExtensions

Copied from original issue: dotnet/aspnetcore#11266

@mkArtakMSFT
Copy link
Member Author

From @mkArtakMSFT on Monday, June 17, 2019 4:35:31 PM

Thanks for contacting us, @GoranHalvarsson.
This is something we've been thinking about for quite some time. Parking in the next milestone for now to discuss what we're going to do here.

@mkArtakMSFT
Copy link
Member Author

From @GoranHalvarsson on Monday, June 17, 2019 7:26:44 PM

Im glad you will do this 😄

@scalablecory
Copy link
Contributor

@mkArtakMSFT HttpClient.GetJsonAsync is an extension method defined in the ASP repo, not part of corefx. Please re-open the original issue and close this one.

@jozkee
Copy link
Member

jozkee commented Apr 7, 2020

Fixed on #33459.

The parameter JsonSerializerOptionsProvider.Options should be accessible.

This will be tracked on #34626

@jozkee jozkee closed this as completed Apr 7, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants