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
This nice library helps me to register a polymorphic tree of (with string discriminator property Type and "unlimited" nested steps that implements the same IStep interface).
During deserialization of such tree, I'd like to "detect" all objects that don't have (supported) Type. And it should not throw on a first (mis-)match.
As of today, I did not find any better than either traverse a tree again or use a "trap" fallback type (In constructor it adds each "unknown" Type to a static list. (non-multithreading solution that requires a cleanup after deserialization).
What do you think could be a better solution to this?
I'm thinking about adding a support for invoking a (registered) delegate or raising (weak) event or notifying an observable.
It could be done in addition to JsonSubtypesConverterBuilder.SetFallbackSubtype(Type) and JsonSubtype.ResolveType() looks like a perfect extension point.
This nice library helps me to register a polymorphic tree of (with string discriminator property
Type
and "unlimited" nested steps that implements the sameIStep
interface).During deserialization of such tree, I'd like to "detect" all objects that don't have (supported)
Type
. And it should not throw on a first (mis-)match.As of today, I did not find any better than either traverse a tree again or use a "trap" fallback type (In constructor it adds each "unknown"
Type
to a static list. (non-multithreading solution that requires a cleanup after deserialization).What do you think could be a better solution to this?
I'm thinking about adding a support for invoking a (registered) delegate or raising (weak) event or notifying an observable.
It could be done in addition to
JsonSubtypesConverterBuilder.SetFallbackSubtype(Type)
andJsonSubtype.ResolveType()
looks like a perfect extension point.*** Source/destination types
*** Source/destination JSON
The text was updated successfully, but these errors were encountered: