Open
Description
Description
Trying to figure out why my code keeps failing, and it when looking further into the generated code, there seems to be no converter being added to the Default
context property. It has a count of 0 no matter how I try to use it.
[JsonSourceGenerationOptions(
GenerationMode = JsonSourceGenerationMode.Default,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
Converters = [
typeof(AccountId.AccountIdSystemTextJsonConverter)
])]
[JsonSerializable(typeof(AccountMembership))]
[JsonSerializable(typeof(AccountId))]
public partial class SourceGenerationContext : JsonSerializerContext
{
}
Reproduction Steps
Create SourceGenerationContext using the shared code above.
View that the Default.Optons.Converters is empty.
Expected behavior
The list of converters given in the JsonSourceGenerationOptions attribute be set within the Default options. for the context
Actual behavior
No converters added.
Regression?
No response
Known Workarounds
No response
Configuration
.Net 9.0.6
Other information
No response