-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
The JsonSerializer is not trim-compatible when not using the JSON source generator (see #51886). However, we have a bunch of "trimming tests" that used it in a trimmed app, but only for one level of objects (like just one Hashtable
or Queue<T>
).
I am removing a bunch of these tests while working on #52268 and #53256 because they no longer pass after these issues are resolved.
However, supporting these scenarios in a trimmed app is important. The trim-compatible way to use JsonSerializer is to use the JSON source generator, and pass in the generated JsonTypeInfo<T>
to the JsonSerializer.
We should re-do these trimming tests to use the JSON source generator and add them back. However, this can't happen until the JSON source generator supports all the collection types that the JsonSerializer supports (#53393).
This issue is to track bringing all these trimming tests using the JSON source generator.
cc @layomia