Click here to Skip to main content
15,885,014 members
Articles / Programming Languages / Markdown

APJSON

Rate me:
Please Sign up or sign in to vote.
4.67/5 (5 votes)
28 Aug 2013CPOL13 min read 41.6K   1.2K   34  
This is an alternative for "fastJSON"
Changes in 0.92:

- [DONE] Removing support of xmlignore attribute, it is replaced by DataMember, IgnoreDataMember
- [DONE] JsonPrimitive custom type support.
- [DONE] NEW: Silverlight 5 support.
- [DONE] NEW: A SerializationException when an attempt is done to serialize a class without (visibile) properties. Previously, this was rendering to '{}' which will lead to problems on receivers side.
- [DONE] NEW: Json.ToJsonBytes returns a byte array representing the json string bytes in the configured encoding.
- [DONE] NEW: A date time property can be decorated with the DateTimeOptions attribute which defines the expected kind of date time (utc or not). The deserializer will respect this, if the incoming date time is utc (otherwise the kind is 'unknown' and it could just guess what to do).
- [DONE] CHANGE: Thread static attribute has been removed from Json class. It was causing irritiations, since each thread had its own default parameters. Any change applied to the parameters needed to be re-set for each worker thread.
- [DONE] FIX: Can register custom type handler for non default json parameters.
- [DONE] FIX: DateTime deserialization was always converting to local time. Now the field can declare the JsonDateTimeOptions attribute which allows to specify the desired value.
- [DONE] FIX: If last property is null or empty and SerializeNullValues is true, a final ',' was rendered anyway (ie. { i:1,} where 'j' is nullable and null)
- [DONE] Increasing unit test depth on JsonRegistry.
- [DONE] Improved error reporting when duplicate data member is detected

Known Limitations and Issues
- HashSet in deserialization is not supported (lack of interface to populate the hash set collection).
- DataMember with Name = "$type" and comparable is still allowed and leads potentially to wrong behavior.
- InvalidProgramException when property indexer is defined on class to serialize

Points of interest
- Only public classes should participate on serialization. Serialization may or may not work, depending on security settings and .net version
- All properties should be public get/set for optimal performance. Internal members are also considered, but performance is significally lower.
- Deserialization into non-public types fails with TypeAccessException.

================================================
Upcoming Changes 0.93:
- IJsonValue AsXXXX is obsolete. Use implicit operators instead



By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions