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

Remove non-generic dynamic-returning JSON methods #699

Closed
tmenier opened this issue Jun 3, 2022 · 0 comments
Closed

Remove non-generic dynamic-returning JSON methods #699

tmenier opened this issue Jun 3, 2022 · 0 comments

Comments

@tmenier
Copy link
Owner

tmenier commented Jun 3, 2022

4.0 will drop the the Newtonsoft.Json dependency and use System.Text.Json instead. But that library does not support deserializing to dynamic as Newtonsoft does, making it difficult at best to continue to support Flurl's non-generic dynamic-returning methods like GetJsonAsync(). The .NET team's rationale includes the fact that dynamic is now "archived" tech and therefore newer APIs shouldn't take a dependency on it.

So far the consensus seems to favor the outright removal of these methods from the core library, but feel free to weigh in here with your thoughts.

I intend to provide a NewtonsoftSerializer implementation compatible with 4.0 and onward for anyone who wants it. This will either be in the form of a separate NuGet package or just a gist (it's pretty tiny). Some of those pre-4.0 methods could be included, although doing it without them is as easy as:

// requires Newtonsoft-based serializer!
dynamic d = await requestOrUrl.GetJsonAsync<ExpandoObject>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Released
Development

No branches or pull requests

1 participant