Dahomey.Json icon indicating copy to clipboard operation
Dahomey.Json copied to clipboard

Configurable way to ignore a unrecognized discriminator.

Open kevbite opened this issue 2 years ago • 0 comments

We have an API Client that may get out of sync with the server contract, however, at the moment the polymorphism support just blows up if there's no matching discriminator. It'd be useful if there's a way to skip over an unrecognized discriminator or at last a fallback type.

It seems that we can create our own DiscriminatorConvention and make that fall back to a fallback type, but that convention is applicable across all discriminators which means a model with multiple polymorphic structures would be impossible to fall back to an unknown type.

I'm happy to have a stab at the first, of having some kinda way to skip over an unrecognized discriminator which is configurable?

kevbite avatar Apr 26 '22 15:04 kevbite