You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug]: Default ObjectToInferredTypesConverter causes TypeDiscriminator property to be missing in top-level types for polymorphic JSON Serialization
#1763
Open
Greenscreener opened this issue
Jul 24, 2024
· 1 comment
When using the SystemTextJsonContentSerializer with default JsonSerializerOptions including the ObjectToInferredTypesConverter, TypeDiscriminator properties used in Polymorphic JSON Serialization are ignored in first-level objects, even though nested types receive their TypeDiscriminator properties correctly.
Step to reproduce
Use the default SystemTextJsonContentSerializer with default configuration.
Create a type with a polymorphic serilaization configiuration, for instance:
Describe the bug 🐞
When using the
SystemTextJsonContentSerializer
with defaultJsonSerializerOptions
including theObjectToInferredTypesConverter
, TypeDiscriminator properties used in Polymorphic JSON Serialization are ignored in first-level objects, even though nested types receive their TypeDiscriminator properties correctly.Step to reproduce
SystemTextJsonContentSerializer
with default configuration.Reproduction repository
No response
Expected behavior
TypeDiscriminator property should be present
Screenshots 🖼️
No response
IDE
No response
Operating system
No response
Version
No response
Device
No response
Refit Version
No response
Additional information ℹ️
No response
The text was updated successfully, but these errors were encountered: