[docs] NestJS serialization vs MikroORM serialization #65
Replies: 2 comments 2 replies
-
PR welcome 👍 Note that serialization with class-transformer is possible, you just need to return the DTO, not entity (so Maybe we could have some kind of extension for class-transformer? |
Beta Was this translation helpful? Give feedback.
-
Ok I'll make a PR 👍 DTO ---> Entity : For me there's no issue here in the NestJS context. It provides a Entity ---> DTO : Here's my understanding of the possible solutions :
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
tldr;
First of all, thanks for this amazing project.
I think we could improve the documentation regarding one aspect : serialization.
NestJS documentation about serialization is pushing developers towards class-transformer and interceptors.
In the context of MikroORM, this is misleading. Concepts like
Collection
,Reference
etc are not compatible with class-transformer, and people who are following NestJS serialization techniques by the book are getting stuck (well, I was).I think that this incompatibility is not an issue at all, the built-in serialization in MikroORM is equivalent. But the NestJS integration should display a clear warning about that.
Related links :
What do you guys think ? Happy to submit a PR.
Beta Was this translation helpful? Give feedback.
All reactions