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
I'm currently trying to solve #660 in our project, by duplicating AnchorAssigner and replacing assignments dictionary definition to a compare by reference one. However, when I'm building the serializer, I found that WithPreProcessingPhaseObjectGraphVisitor() doesn't take a Func type as the parameter, so I need to instantiate my own ReferenceEqualAnchorAssigner but I don't know how can I get type converters.
So I would like to know is there a way to get a list of type converters?
My code is
newSerializerBuilder().ConfigureDefaultValuesHandling(DefaultValuesHandling.Preserve)// expecting something `like typeConverters => new ReferenceEqualAnchorAssigner(typeConverters)` for the first argument.WithPreProcessingPhaseObjectGraphVisitor(newReferenceEqualAnchorAssigner(???), w =>w.InsteadOf<AnchorAssigner>()).WithEmissionPhaseObjectGraphVisitor(args =>newAnchorAssigningObjectGraphVisitor(args.InnerVisitor,args.EventEmitter,args.GetPreProcessingPhaseObjectGraphVisitor<ReferenceEqualAnchorAssigner>()),
w =>w.InsteadOf<AnchorAssigningObjectGraphVisitor>()).Build();
and ReferenceEqualAnchorAssigner is the same as AnchorAssigner except assignments:
There are 3 pre-built type converters, the DateTimeConverter, GuidConverter and SystemTypeConverter. They are in the YamlDotNet.Serialization.Converters namespace. In the serializer/deserializer builder base class, only GuidConverter and SystemTypeConverter are registered. I do see a way to remove type converters, but not add. You can see the code where it adds the type converters here:
I'm currently trying to solve #660 in our project, by duplicating
AnchorAssigner
and replacingassignments
dictionary definition to a compare by reference one. However, when I'm building the serializer, I found thatWithPreProcessingPhaseObjectGraphVisitor()
doesn't take aFunc
type as the parameter, so I need to instantiate my ownReferenceEqualAnchorAssigner
but I don't know how can I get type converters.So I would like to know is there a way to get a list of type converters?
My code is
and
ReferenceEqualAnchorAssigner
is the same asAnchorAssigner
exceptassignments
:The text was updated successfully, but these errors were encountered: