Created
September 27, 2023 09:22
-
-
Save trnktms/97cbfb3a254e474220e17cd2c498c646 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FallbackDeliveryApiJsonTypeResolver : DeliveryApiJsonTypeResolver | |
{ | |
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options) | |
{ | |
var typeInfo = base.GetTypeInfo(type, options); | |
if (typeInfo.PolymorphismOptions != null) | |
{ | |
typeInfo.PolymorphismOptions.UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType; | |
} | |
return typeInfo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment