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:

Zoneless Change Detection In Angular 18

Zoneless change detection in Angular 18

Angular v18 introduced an experimental feature called zoneless change detection, eliminating the need for Zone.js.

Yan Sun
Jul 15, 2024 ⋅ 5 min read
Developing Cross Platform Apps With Bun Version 1.1

Developing cross-platform apps with Bun v1.1

For some years now, developers have faced many performance challenges while using traditional JavaScript runtimes like Node.js and Deno. Even […]

Clara Ekekenta
Jul 12, 2024 ⋅ 6 min read
Exploring The Magic Of Runes In Svelte 5

Exploring the magic of runes in Svelte 5

See how to use Svelte 5’s new runes system to declare reactive states and compare them to the existing approach to reactivity in Svelte 4.

Yashodhan Joshi
Jul 11, 2024 ⋅ 7 min read
Building UIs With Franken UI, A Shadcn Alternative

Building UIs with Franken UI, a Shadcn alternative

Explore Franken UI, an open source library of pre-built UI components that takes inspiration from Shadcn UI’s design principles.

Jude Miracle
Jul 10, 2024 ⋅ 11 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