- Throw error (again) when expected primitive type is object or array, closes #187
- Fix handling of array property type mapping, fixed with PR #142
- Improve method types, closes #137
- Change property decorator flags, closes #138
- Add esm module format in order to fix CommonJS issue with Angular 10, closes #147
- Improved docs about property initialization, closes #149
- Implement discriminator feature, closes #165
- Improve discriminator feature and add lazy-loading to prevent circular dependencies, closes #181
- There are no breaking changes to be expected.
The usage of the third parameter of the
@JsonProperty
decorator has slightly changed but is downward compatible. Collisions with class identifiers in the@JsonObject
decorators now throw an error.
- Fixed compile due to bad
package.json
when using older TypeScript versions, closes #132
- Fixed compile issues when using older TypeScript versions, closes #131
- The older versions did not enforce developers the use of the
@JsonObject(classIdentifier)
decorator. If you do not use the class decorator or have no parameter given, please update according to the docs. This is now mandatory, closes #129 and #130
- Fixed content of
package-lock.json
, closes #125
- Implemented
ignoreRequiredCheck
flag and allow serialization without having instances, closes #126
- In previous version, the serialization of plain objects failed, because instances of classes were required. As of now, the serialization of plain object may succeed if the structure matches the class structure. Thus, this is considered a soft breaking change.
- Added missing Changelog for current version, closes #124
- Added automation tests on the repository with Travis CI
- Fixed bug in property mapping of complex class inheritances, closes #121
- Wrong output files were included in v1.2.x builds, closes #98
- Corrected ReadMe information, closes #97
- Corrected ReadMe information, closes #88
- Allow optional properties to be null, closes #58
- If a property is declared optional (by
@JsonProperty(name, Type, true)
), thennull
is now ignored in both serialization and deserialization. Before this version,json2typescript
would have thrown an error ifValueChecking.DISALLOW_NULL
was used.
- Improved documentation for v1.1.0
- Implemented pull request that fixes an issue with child class properties, closes #80
- Fixed bug in constructor parameters, closes #82
- Added generics in order to allow the compiler to detect types, closes #73
- Allow case insensitive lookup in json deserializing, closes #81
- It is not possible to serialize
undefined
anymore; instead, an error is thrown. Before this version,json2typescript
serializedundefined
tonull
.
- Fixed serialization and deserialization of
null
andundefined
values, closes #33 and #69 - Adjusted README to close #40
- Removed js map files, closes #60
- Allowed custom class identifiers in the
@JsonObject
property, closes #66
- Fixed issues with activated
strictNullChecks
- Added README note about circular dependency issues
- Removed ts files from publishing, added declaration files instead
json2typescript
will now throw an exception if theJsonProperty
decorator hasundefined
as second parameter. PassAny
if you want to skip the type check instead or don't pass the second parameter at all.Any
is a type fromjson2typescript
and needs to be imported
- Fixed bug in serialization mode
- Fixed issue with class properties when extending another class, closes #22
- Allow
json2typescript
to work withnoImplicitAny
, closes #23
- Fixed issue with
ValueCheckingMode
by using an enum instead of a nested class, closes #10 and #11 - Added missing js references, closes #11 and #16
- Allow serialization the same way as deserialization, closes #4
- Added smart methods
serialize()
anddeserialize()
for simplified usage - Added custom converters, closes #6
- Use class methods instead of static methods, closes #14
- Use an instance of
JsonConvert
and its class methods instead of the static methods - The static class properties
valueCheckingMode
anddebugMode
are not static anymore.debugMode
has been renamed tooperationMode
. Their values should be assigned through the given enums with the same name - Removed the string method
deserializeString()
due to the fact that it is the same asjsonConvert.deserialize()
combined withJSON.stringify()
Fixed errors in ReadMe and small bug on JsonConvert.
New method for deserializing array of objects.
Class properties are now not overridden to undefined
if there is no decorator and no matching json value.
It is now possible to map an JSON object to an TypeScript array, then the object keys become the array keys. Also, class properties can be set to optional. See below in the chapter "decorators" for more information.
Added method serializeString()
, changed property names and behaviour.
First version released to the public.