-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Polymorphic Deserialization Based on Property #4714
Comments
Could you try |
When used JsonTypeInfo.Id.DEDUCTION it asking for unique properties between classes.. When TypeIdResolver is used I might need to create multiple Resolver for each MainType |
While we can leave this issue open, I do not think we will be pursuing anything like this: existing options can be improved but I really do not want to further complicate logic of polymorphic type resolution. Specifically, no plans to combine DEDUCTION approach with properties-based variants: I am still not sure if adding |
Is your feature request related to a problem? Please describe.
Currently Polymorphic Deserialization without type indicator can be done in different ways
ID.DEDUCTION
`
Property Value
`
As mentioned these are existing flow..
I'm proposing to Deserialize based on difference in property example as below ClassA having 2 and classB having 3.. When in a scenario
`
}
`
Describe the solution you'd like
Below scenario with which class to Map.. Please refer problem for ClassA & ClassB definition
Usage example
Polymorphic definition based on type property and value is okay.. But based on class definition will be more useful
Additional context
No response
The text was updated successfully, but these errors were encountered: