appvision-gmbh / json2typescript

Map JSON to a TypeScript class with secure type checking!
https://www.npmjs.com/package/json2typescript
MIT License
278 stars 55 forks source link

Properties of child classes not (de)serialized #129

Closed andreas-aeschlimann closed 4 years ago

andreas-aeschlimann commented 4 years ago

The documentation should state that since around v1.2.0+, properties of child classes do not work anymore unless the @JsonObject("ClassName") is provided. Right now this seems rather optional.

tobiasschweizer commented 4 years ago

Right now this seems rather optional.

If you don't know whether it's optional or not, then no one does ;-)

andreas-aeschlimann commented 4 years ago

It is due to the changes in the inheritance handling that were made in https://github.com/AppVision-GmbH/json2typescript/pull/121

So we basically missed a breaking change in the update v1.2.5: The class decorator parameter 1 must not be empty for child classes.

tobiasschweizer commented 4 years ago

It is due to the changes in the inheritance handling that were made in #121

So we basically missed a breaking change in the update v1.2.5: The class decorator parameter 1 must not be empty for child classes.

Ok, I get it. So then documenting it would be good.

andreas-aeschlimann commented 4 years ago

Yes, and I will also force the use of a parameter whenever the @JsonObject decorator function is called. Then developers cannot miss bad implementations.