-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
JsonSerializer support for JsonDocument types in source generation mode #59954
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json Issue Details
|
I can do this! |
I created PR #60236 to fix this. Let me know if I did it right and if there are any improvements I can do! |
Does this need API review before we mark up-for-grabs? |
Yes the following API needs to be reviewed and approved before we can merge #60236. My apologies @strobelt. namespace System.Text.Json.Serialization.Metadata
{
public static partial class JsonMetadataServices
{
public JsonConverter<JsonElement> JsonElementConverter { get; }
+ public JsonConverter<JsonDocument> JsonDocumentConverter { get; }
}
} |
No problem, @layomia! Thanks for the help! |
I think we can use your existing PR @strobelt. We can look at getting the API approved concurrently. |
namespace System.Text.Json.Serialization.Metadata
{
public static partial class JsonMetadataServices
{
// Existing
// public JsonConverter<JsonElement> JsonElementConverter { get; }
public JsonConverter<JsonDocument> JsonDocumentConverter { get; }
}
} |
JsonSerializer
supports (de)serialization ofJsonDocument
instances. We should add the same support in source-generation mode by exposing theJsonDocumentConverter
via a newJsonMetadataServices
API.The text was updated successfully, but these errors were encountered: