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

Improve discriminator usage #180

Closed andreas-aeschlimann closed 2 years ago

andreas-aeschlimann commented 2 years ago

As discussed in https://github.com/appvision-gmbh/json2typescript/pull/165, we should test and merge this PR before releasing v1.5.0.

andreas-aeschlimann commented 2 years ago

Looks good so far @Catter38, only one test seems to fail:

✖ should not get class from discriminator property if enabled but no classes provided

If you find time, you can fix it. Otherwise I will try to do it.

I am currently working on an idea about type imports that would allow json2typescript to bypass circular dependencies. The idea is that you can use json2typescript even with scenarios of a class A importing B and B importing A. TypeScript has introduced "type imports" in version 3.8 that allow this.

andreas-aeschlimann commented 2 years ago

Closing in favor of #181