Skip to content
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

Caching ignores serialization options #22

Open
sluchznak opened this issue Aug 4, 2021 · 0 comments
Open

Caching ignores serialization options #22

sluchznak opened this issue Aug 4, 2021 · 0 comments

Comments

@sluchznak
Copy link

sluchznak commented Aug 4, 2021

Hello. I found that your implementation of cache manager ignores serialization options.

// app initialization
// ....
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
// ...

// DTO
class DtoClass {
  @Expose()
  id: string;

  @Expose({ groups: ["public"] })
  price: number;
}


// Controller
@CacheTTL(10000)
@SerializeOptions({ groups: ["public"], excludeExtraneousValues: true })
@Get("list")
handler(): DtoClass {
  return new DtoClass({ id: "123", price: 123, extraneousValue: "123" });
}

As a result extraneousValue will be in cached response. Default in-memory cache manager works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant