Skip to content

Commit c370753

Browse files
authored
Fix diamond problem example for JsonPolymorphic (#32683)
1 parent 1815da0 commit c370753

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/standard/serialization/system-text-json/polymorphism.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ However, falling back to the nearest ancestor admits the possibility of "diamond
628628
[JsonPolymorphic(
629629
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToNearestAncestor)]
630630
[JsonDerivedType(typeof(BasePoint))]
631+
[JsonDerivedType(typeof(IPointWithTimeSeries))]
631632
public interface IPoint { }
632633

633634
public interface IPointWithTimeSeries : IPoint { }
@@ -641,6 +642,7 @@ public class BasePointWithTimeSeries : BasePoint, IPointWithTimeSeries { }
641642
<JsonPolymorphic(
642643
UnknownDerivedTypeHandling:=JsonUnknownDerivedTypeHandling.FallBackToNearestAncestor)>
643644
<JsonDerivedType(GetType(BasePoint))>
645+
<JsonDerivedType(GetType(IPointWithTimeSeries))>
644646
Public Interface IPoint
645647
End Interface
646648

0 commit comments

Comments
 (0)