If someone is using "Microsoft.AspNet.WebApi.Client" but migrated from "JsonPropertyAttribute" (Newtonsoft.Json) to "JsonPropertynameAttribute" (System.Text.Json) the serialization property names are ignored.
Please add a warning on the "Microsoft.AspNet.WebApi.Client" chapter that is still necessary to keep previous attributes or provide a way to change the JSON serializer.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@JamesNK please review and suggest an edit.
Out of curiosity, will Microsoft.AspNet.WebApi.Client
swap over to System.Text.Json
in v6 or later?
I've just written some code with a dependency on just Microsoft.AspNet.WebApi.Client
, so the Newtonsoft.Json
dep is transitive. I'm guessing that'll mean if you guys shift over to System.Text.Json
instead, JsonProperty
won't exist anymore and the build will break; that's great - it'll fail fast. But there's definitely projects I can imagine that will have Newtonsoft.Json
still in the dependency tree and people will just forget to update their JsonProperty
attributes.
I guess at the end of the day if it's a major version update for Microsoft.AspNet.WebApi.Client
there just needs to be ample documentation and warning for folks. It'd be great if this could be covered by an analyzer, but that could be very hard.
Most helpful comment
Out of curiosity, will
Microsoft.AspNet.WebApi.Client
swap over toSystem.Text.Json
in v6 or later?I've just written some code with a dependency on just
Microsoft.AspNet.WebApi.Client
, so theNewtonsoft.Json
dep is transitive. I'm guessing that'll mean if you guys shift over toSystem.Text.Json
instead,JsonProperty
won't exist anymore and the build will break; that's great - it'll fail fast. But there's definitely projects I can imagine that will haveNewtonsoft.Json
still in the dependency tree and people will just forget to update theirJsonProperty
attributes.I guess at the end of the day if it's a major version update for
Microsoft.AspNet.WebApi.Client
there just needs to be ample documentation and warning for folks. It'd be great if this could be covered by an analyzer, but that could be very hard.