mgholam / fastJSON

Smallest, fastest polymorphic JSON serializer
https://www.codeproject.com/Articles/159450/fastJSON-Smallest-Fastest-Polymorphic-JSON-Seriali
MIT License
479 stars 147 forks source link

Surrogate Serialization #48

Closed hasanbayatme closed 7 years ago

hasanbayatme commented 7 years ago

Does fastJSON supporting Surrogate Serialization?

If not, let us know.

Thanks.

mgholam commented 7 years ago

Please explain more what you mean.

hasanbayatme commented 7 years ago

Please take a look at: https://msdn.microsoft.com/en-us/library/system.runtime.serialization.surrogateselector(v=vs.110).aspx

mgholam commented 7 years ago

The whole purpose of fastJSON is that surrogates are not needed.

hasanbayatme commented 7 years ago

But sometimes, some classes don't need the some properties to be serialized. we need a surrogate for specifying which properties to be serialized.

mgholam commented 7 years ago

Use XmlIgnore attribute for those properties you don't want to serialize.

hasanbayatme commented 7 years ago

I don't have access to the class.

EDIT: it is a compiled binary. (Unity Game Engine)

hasanbayatme commented 7 years ago

I can't modify class source code. because the class is related to the unity game engine, i just want to serialize it to json format.

mgholam commented 7 years ago

Try and see what happens.

hasanbayatme commented 7 years ago

What do i try? How do i apply XmlIgnore attribute to a closed source?

mgholam commented 7 years ago

Try your surrogates.

hasanbayatme commented 7 years ago

How? does fastjson supports surogate selector?