Skip to content

Releases: JohnWeisz/TypedJSON

0.1.4 Hotfix

02 May 22:38
Compare
Choose a tag to compare
0.1.4 Hotfix Pre-release
Pre-release
  • Fixed TypedJSON.parse engaging custom deserialization (and throwing "not known type" errors where applicable) when the root type was not JsonObject. It will now resort to the JSON.parse function in this case, a root JsonObject type is required when doing custom deserialization.

0.1.3 consistency improvements

02 May 22:20
Compare
Choose a tag to compare
Pre-release

Consistency update and bugfixes. Notable changes and fixes:

  • Serializing/deserializing a non-JsonObject value with JsonMember properties will no longer throw error. It will be ignored in regard to custom deserialization instead, as if no JsonMembers were used on the given class.
    • To use typed serialization/deserialization, always use JsonObject on involved classes.
  • Compiled .js is now included in NuGet package to prevent IntelliSense from occasional panicking.
  • Minor performance improvements.

Breaking changes

  • TypedJSON.config no longer returns the TypedJSON object. This was a ninja feature that has now been removed.

0.1.2 Source Preview

29 Apr 20:17
Compare
Choose a tag to compare
0.1.2 Source Preview Pre-release
Pre-release

Stability update. New version is available as a NuGet package as well:

Install-Package TypedJSON
  • Mashed everything into single file
  • Added .d.ts and .min.js

Breaking changes:

  • TypedJSON.stringify and TypedJSON.parse no longer accept a configuration object. The TypedJSON.config method can be used instead
  • Classes without a parameterless constructor are no longer supported, and their return is not planned
  • Using JsonObject is now mandatory

Fixed issues:

  • Interface and abstract class as property type can now be used (see issues #9 and #10)
    • Requires setting the refersAbstractType option to true (for both abstract classes and interfaces)
    • For interfaces, use Object for the type setting (or use reflect-metadata)
    • Requires type-hint to be enabled (default)
  • Objects in nested arrays should now deserialize correctly (see issue #4)
    • Requires type-hint to be enabled (default)
  • Known types accepting only classes containing a parameterless constructor is now expected behavior (see issue #8)
  • The type of primitive values being deserialized should now be checked correctly (see issue #7)