Maciej Cieślar
Feb 17, 2020 ⋅ 6 min read

Serialization in NestJS: A different approach

Maciej Cieślar A JavaScript developer and a blogger at mcieslar.com.

Recent posts:

Vite Adoption Guide Overview Examples And Alternatives

Vite adoption guide: Overview, examples, and alternatives

Vite is a versatile, fast, lightweight build tool with an exceptional DX. Let’s explore when and why you should adopt Vite in your projects.

David Omotayo
Nov 29, 2023 ⋅ 16 min read
Implementing Advanced Features With The Navigator.Share API

Implementing advanced features with the navigator.share API

Explore advanced capabilities for content sharing with the navigator.share API, including dynamic content sharing, custom share targets, and batch sharing.

David Omotayo
Nov 29, 2023 ⋅ 10 min read
Chas Peacock Leader Spotlight

Leader Spotlight: Scaling for the next phase of growth with Chas Peacock

We spoke with Chas to get his insights on building technology and internal processes for companies that are scaling quickly.

Jessica Srinivas
Nov 29, 2023 ⋅ 7 min read
Cypress Adoption Guide: Overview, Examples, Alternatives

Cypress adoption guide: Overview, examples, and alternatives

Cypress is one of today’s foremost tools for testing web applications. Let’s explore when and why you should adopt Cypress in your projects.

Paul Akinyemi
Nov 28, 2023 ⋅ 10 min read
View all posts

4 Replies to "Serialization in NestJS: A different approach"

  1. Thanks! Great tutorial! Could you please give a repository link with this example ?

  2. Excellent example!, but this does not seems to be working, and there are many files mentioned in this example are missing. Please share the git link for the example Or please update the blog with proper files/ missing file ie., SerializedUserDTO, UserRole.
    and where to use the below line.

    return {
    user: Serializable,
    otherProperty: true,

  3. The core of the issue comes from your lack of DTO. You’re supposed to map your entities to DTO classes, then you can keep ClassSerializerInterceptor and introduce more information in the DTO.

Leave a Reply