Comments (4)
@kunjee17 this is result of having polymorphic deserialization. This means that each serialized payload knows it's own type, so you don't have to provide it manually upon deserialization.
I.e. if you have an array new Animal[] { new Cat(name:"Sam"), new Dog(name:"Max") }
you could deserialize it with serializer.Deserialize<object>(stream)
and you'd still have valid types produced with no need to make casts between them. No JSON serializer would be able to do that without embedding type names in its content.
So this is deliberate decision, deeply set into the library itself.
from wire.
@Horusiath yeah. Seems like that. But what if I am trying to send data over the wire. It is having type details with it. But on other project, types are not exactly the same. (namespace is different to be precise ). Is there any way to do it in that case?
from wire.
@kunjee17 it's a matter of use the right tool for the right problem.
Wire is as @Horusiath says, a polymorphic serializer, meaning it will encode type information in the payload.
While it could in theory be possible to have some form of type replacement support, that feels very much like the wrong way to go.
Use a serializer that fits your needs, it's all about trade offs.
from wire.
Thanks @rogeralsing and @Horusiath for details explanation. I am closing the issue.
from wire.
Related Issues (20)
- NVM
- Serialization of F# Map HOT 4
- No support for struct with a non-default constructor? HOT 8
- Is Serializer thread safe? HOT 2
- AmbiguousMatchException when serializing a type with multiple AddRange methods HOT 1
- Invalid code generation on fields of interface type HOT 5
- Wire performance improvements HOT 3
- CollectionTests.CanSerializeDictionaryKeysAndValuesByteChar is failing HOT 1
- Wire 0.8.2 is not compatible with 0.8.1 HOT 6
- Stack overflow when serializing/deserializing LinkedList
- OSS license for Wire HOT 2
- Support for IDictionary HOT 3
- Speedup dials to compare performance with bond simple binary protocol.
- .NET Core serialization issues
- Signed Wire NuGet package
- support DataContract/DataMember/IgnoreDataMember
- Does wire do zig-zag / 7bit encoding?
- Wire.Extensions.TypeEx CoreAssemblyName ignore mscorelib/System.Private.CoreLib
- .NET Core 3 - Cannot Deserialize
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wire.