Skip to content

fix: Expose not working correctly with toClassOnly #1692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kpiatkowski opened this issue Apr 8, 2024 · 2 comments
Closed

fix: Expose not working correctly with toClassOnly #1692

kpiatkowski opened this issue Apr 8, 2024 · 2 comments
Labels
status: duplicate Issue is being tracked already in another issue.

Comments

@kpiatkowski
Copy link

kpiatkowski commented Apr 8, 2024

Description

I have data that is incoming from 3rd party provider, and I need to transform properties to my internal structure and be able to export it that way too. Basically I just need to transform keys while importing.

class TestClass {
  @Expose({ name: "Test", toClassOnly: true })
  public test: string;
}

const instance = plainToInstance(TestClass, { Test: "something" });
const plain = instanceToPlain(instance);

console.log(instance);
console.log(plain);

Expected behavior

TestClass { test: 'something' }
{ test: 'something' }

Actual behavior

TestClass { test: 'something' }
{ Test: 'something' }
@kpiatkowski kpiatkowski added status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature. labels Apr 8, 2024
@diffy0712
Copy link

Duplicate of #1324

@diffy0712 diffy0712 marked this as a duplicate of #1324 May 5, 2024
@diffy0712 diffy0712 closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2024
@diffy0712 diffy0712 added status: duplicate Issue is being tracked already in another issue. and removed type: fix Issues describing a broken feature. status: needs triage Issues which needs to be reproduced to be verified report. labels May 5, 2024
Copy link

github-actions bot commented Jun 5, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: duplicate Issue is being tracked already in another issue.
Development

No branches or pull requests

2 participants