-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Json Source Generator no code generated for Deserialize? #78602
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsI was trying out source generators with .NET 7.0 and found a nice win of 20+% for the serialize case. Deserialize on the other hand did not really change, except for warmup. When I set GenerationMode = JsonSourceGenerationMode.Serialization the code fails with an exception during deserialize.
Does this mean the mode JsonSourceGenerationMode.Serialization only generates code for the serialization logic, but not for deserialization? I this the reason why the default is to generate both? Is there some feature missing to not generate the metadata, but use pregenerated code for serialize and deserialize?
`
`
|
Fast-path deserialization has not been implemented yet, see #55043. If you need your source generator to support deserialization you should use the default |
I was trying out source generators with .NET 7.0 and found a nice win of 20+% for the serialize case. Deserialize on the other hand did not really change, except for warmup.
When I set GenerationMode = JsonSourceGenerationMode.Serialization the code fails with an exception during deserialize.
Does this mean the mode JsonSourceGenerationMode.Serialization only generates code for the serialization logic, but not for deserialization? I this the reason why the default is to generate both? Is there some feature missing to not generate the metadata, but use pregenerated code for serialize and deserialize?
When I can have generated code why should I ever want to enable JsonSourceGenerationMode.Metadata, except to get some fallback when the generated code does not support some scenarios? Will there be a JsonSourceGenerationMode.Deserialization mode, or did I just call the wrong overload to use the pregenerated code?
`
`
The text was updated successfully, but these errors were encountered: