NestJS
NestiaΒ is the NestJS integration layer built on top of typia. It replaces the usual class-validator + @nestjs/swagger setup with decorators that read your TypeScript interfaces directly β no DTO classes, no decorator soup.
It ships four packages:
| Package | What it does |
|---|---|
@nestia/core | Superfast NestJS decorators backed by typia (@TypedBody, @TypedRoute, @TypedQuery, β¦) |
@nestia/sdk | Evolved SDK and Swagger generators that read NestJS controllers and emit type-safe client code |
@nestia/migrate | Swagger β NestJS scaffolding |
nestia | CLI for the above |
Minimal controller
import { Controller } from "@nestjs/common";
import { TypedBody, TypedRoute } from "@nestia/core";
import type { IBbsArticle } from "@bbs-api/structures/IBbsArticle";
@Controller("bbs/articles")
export class BbsArticlesController {
/**
* Store a new content.
*
* @param input Content to store
* @returns Newly archived article
*/
@TypedRoute.Post() // ~200x faster, type-safe JSON.stringify
public async store(
@TypedBody() input: IBbsArticle.IStore, // ~20,000x faster validator
): Promise<IBbsArticle> {
/* β¦ no DTO class. Plain interface works. */
}
}The decorators are interchangeable with the standard NestJS ones β same shape, same testing approach, much less boilerplate. @TypedBody validates with typia.assert and @TypedRoute serializes with typia.json.assertStringify.
Incremental adoption
You can add @TypedBody / @TypedRoute to a single route without touching the rest of the codebase. Specifically:
@TypedBodyand@Bodycoexist on different routes of the same controller. Existingclass-validator-decorated DTOs keep working; you migrate route by route.- The build still uses
tscβ but it must be thets-patch-patchedtsc. Add the legacy setup (wizard or manual) once, and from then on your existingnpm run buildkeeps the same shape. CI pipelines that runnpm ci --ignore-scriptsneed an explicitnpx ts-patch installafter install β see the CI tip on the Legacy setup page. @nestia/sdkruns alongside@nestjs/swaggerduring migration. The two generators emit different artifacts (typed client SDK vs Swagger JSON), so you can keep@nestjs/swaggeruntil every controller is on@TypedRoute, then drop it.
SDK generation
@nestia/sdk reads the same controller files and emits a typed client SDK plus a Swagger document. The TypeScript types you wrote on the server become the request/response types on the client, automatically.

- Left: NestJS server code
- Right: Client code using the generated SDK
Where to go next
- Full Nestia docs: nestia.ioΒ
- The underlying validator/serializer pair:
assertΒ·json.assertStringify - LLM agents that drive a Nestia backend: Agentica