dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

Misleading "Applies to" Section for Json Serialization

Open mariesophie opened this issue 9 months ago • 4 comments

I wanted to use the JsonDerivedType or JsonPolymorphic attribute in a .NET 6 project. So I looked it up at the docs (see links) and was happy, because they are listed as available since .NET 6. I tried, but couldn't even get the code to compile. Finally, I found the Learn .NET section about json serialization again, where both of them seem to be available only in .NET 7 or later.

Is there a way to get the attributes working in .NET 6, is my understanding of the "applies to" section skewed or is it a mishap in the documentation?

mariesophie avatar May 02 '24 07:05 mariesophie

@mariesophie For .NET 6, the APIs are available through the following package: https://www.nuget.org/packages/System.Text.Json/8.0.3.

gewarren avatar May 02 '24 21:05 gewarren

Related to #8405, #9771.

gewarren avatar May 02 '24 21:05 gewarren

Oh, thanks, that's good to know. I like your proposal, which clarifies whether the attribute (in this case) or whatever function is builtin or package-provided. One of the referenced links also guided me to the APIs of .net catalog, which is another help.

mariesophie avatar May 03 '24 13:05 mariesophie

@mariesophie Thanks for reminding me that there's still some work needed in the Applies to section. I've logged an internal work item for that.

gewarren avatar May 03 '24 17:05 gewarren

Since we have an internal work item, I think it's safe to close this issue. @mariesophie thanks for reporting the issue, please open a new one if you have additional questions.

carlossanlop avatar May 07 '24 17:05 carlossanlop

Tagging subscribers to this area: @dotnet/area-system-text-json