[Mono-dev] Proposed Extension to System.Web.Script.Serialization

Konstantin Triger kostat at mainsoft.com
Wed Sep 5 01:59:07 EDT 2007

Hello Tyler,

I'm not sure this extension is required:
1. There is already a mechanism for overriding the default
de/serialization behavior by using TypeConverter (as you say in (b) ).
2. Ability to change names is usually less important for JSON
serialization, since a developer controls both, the server code and the
client side script.

Can you please provide a generic use case for need of this extension?


> -----Original Message-----
> From: R. Tyler Ballance [mailto:tyler at monkeypox.org]
> Sent: Monday, September 03, 2007 5:45 AM
> To: mono-devel-list at lists.ximian.com
> Cc: Igor Zelmanovich; Konstantin Triger
> Subject: Proposed Extension to System.Web.Script.Serialization
> Firstly, I'm so glad we have System.Web.Script.Serialization now,
> The one major thing missing from JSON serialization (contrasted to
> XML serialization) is the ability to tell the serializer how to
> serialize out your object's attributes, in terms of names. I asked
> James Newton-King about this for Json.NET and he forwarded me a
> modified version of Json.NET that allowed such a beast and I've
> ported it over to our System.Web.Script.Serialization, the only thing
> holding me from committing it is:
> 	a) Permission from Igor and Konstantin
> 	b) The fact that .NET doesn't actually define something like
this in
> their API
> Executing my little test application (attached: JsonTest.cs), my
> "Message" property is serialized out under a different name (insanely
> helpful when dealing with existing JSON APIs and code)
> > [mono] \w @ mono JsonTest.exe
> > Serializing TestClass out as: {"my_magic_message":"magic!"}
> Attached is the cumulative patch for mcs/class/System.Web.Extensions/
> System.Web.Script.Serialization, I'd like some review and permission
> to go ahead and commit it :D
> (patch diffed against rev 85204)
> Cheers,
> -R. Tyler Ballance

More information about the Mono-devel-list mailing list