class-transformer icon indicating copy to clipboard operation
class-transformer copied to clipboard

fix: discriminator-based resolution

Open kol-93 opened this issue 2 years ago • 11 comments

Description

Fixed:

  • type discriminator property deleted from source object after plainToInstance/instanceToPlain
  • cannot read property name of undefined/cannot read property constructor of null when trying to transform non-object (like null) to @Type() with discriminator
  • non-exposed type discriminator property when using instanceToPlain with @Exclude()

Added all functional tests for:

  • Classes with @Exclude()/@Expose()
  • Classes without @Exclude()/@Expose()

Checklist

  • [x] the pull request title describes what this PR does (not a vague title like Update index.md)
  • [x] the pull request targets the default branch of the repository (develop)
  • [x] the code follows the established code style of the repository
    • npm run prettier:check passes
    • npm run lint:check passes
  • [x] tests are added for the changes I made (if any source code was modified)
  • [x] documentation added or updated
  • [x] I have run the project locally and verified that there are no errors

Fixes

fixes #944 fixes #803 fixes #790 fixes #239

kol-93 avatar Feb 21 '22 16:02 kol-93

Hi all, I'm waiting for this fix, any ideas when it will be released?

ionutholbia avatar Apr 20 '22 14:04 ionutholbia

Hi all, I'm waiting for this fix, any ideas when it will be released?

Many people are waiting for this fix, but authors still don't care about. So anyone who cares about this fix can use it as dependency like

npm i class-transformer@npm:@kol1993/class-transformer@^0.5.3-alpha.4

kol-93 avatar May 27 '22 12:05 kol-93

when?

thetilliwilli avatar Jun 17 '22 13:06 thetilliwilli

Hello. I need this fixes too. When will be released?

balkarov avatar Jun 17 '22 13:06 balkarov

Bump! Having issues with this

Hum4n01d avatar Apr 24 '23 07:04 Hum4n01d

Thanks for the PR kol-93 Also needing this. Tagging the last person to merge code in here: @saulotoledo

kwek20 avatar May 30 '23 23:05 kwek20

When will this update be released?

jacksrm avatar Aug 02 '23 14:08 jacksrm

@NoNameProvided I've not been active on the project for a while now. Could you take a look at this request or forward it to someone who could look into it?

saulotoledo avatar Feb 11 '24 11:02 saulotoledo

Bump, this is still an ongoing issue

nedasoo avatar Feb 21 '24 15:02 nedasoo

@NoNameProvided this is very needed feature

Sun1ive avatar May 17 '24 19:05 Sun1ive