This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
External serializer does not take existing instance into account when using BindTo #1383
Labels
Milestone
This is related to #1376
It looks like the the
Nancy.Serializers.*
does not take into account that when you callBindTo
then theBindingContext
can contain an existing instance that should be bound to, they will always try to create a new instancehttps://github.com/NancyFx/Nancy.Serialization.JsonNet/blob/master/src/Nancy.Serialization.JsonNet/JsonNetBodyDeserializer.cs#L81
The same holds true for the ServiceStack serialization package
https://github.com/NancyFx/Nancy.Serialization.ServiceStack/blob/master/src/Nancy.Serialization.ServiceStack/Nancy.Serialization.ServiceStack/ServiceStackBodyDeserializer.cs#L46
We need to make sure we can distinguish an existing instance from a created one, because the Model is set by the
DefaultBinder
https://github.com/NancyFx/Nancy/blob/master/src/Nancy/ModelBinding/DefaultBinder.cs#L334
The text was updated successfully, but these errors were encountered: