Actually I was looking for the use case of the DTO in nestjs when you have the prisma generated types

As we can't use the prisma generated type in the swagger decorator, you will have to use DTOs to make it work, as prisma doesn't provide auto generated DTOs

It's in discussion and it's a big subject, I don't know if they planned to add this feature in the future version, but actually to make your swagger work you will have to pass by DTOs

You can find some libs to generate this DTOs for you using your prisma schema as https://www.npmjs.com/package/tsoa

I didn't reviewed it myself as I m still looking for the one that could work properly, so you will probably have to make some search too

But to answer your main question, no you can't use prisma generated type for now :')

Answer from Valentin on Stack Overflow
🌐
Prisma
prisma.io › blog › nestjs-prisma-rest-api-7D056s1BmOL0
Build a REST API with NestJS, Prisma 7, PostgreSQL and Swagger
June 3, 2022 - You will get started by creating a new NestJS project. Then you will start a PostgreSQL database and connect to it using Prisma. Finally, you will build the REST API and document it with Swagger.
🌐
freeCodeCamp
freecodecamp.org › news › build-a-crud-rest-api-with-nestjs-docker-swagger-prisma
How to Build a CRUD REST API with NestJS, Docker, Swagger, and Prisma
January 23, 2024 - A snapshot of the Swagger UI showcasing all the implemented endpoints. ... NestJS: A progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
🌐
GitHub
github.com › prisma › blog-backend-rest-api-nestjs-prisma
GitHub - prisma/blog-backend-rest-api-nestjs-prisma: A simple backend REST API for a blog built using NestJS, Prisma, PostgreSQL and Swagger. · GitHub
A simple backend REST API for a blog built using NestJS, Prisma, PostgreSQL and Swagger. - prisma/blog-backend-rest-api-nestjs-prisma
Starred by 189 users
Forked by 45 users
Languages   TypeScript 93.6% | JavaScript 6.4%
🌐
Medium
medium.com › @teten.nugraha › building-a-rest-api-with-nestjs-and-prisma-orm-e52c8e182ae3
Building a REST API with NestJS and Prisma ORM | by Teten Nugraha | Medium
October 5, 2022 - Now, any module in the application can use PrismaService and be injected into any component/service. This is the common pattern in the NestJS framework. Prisma setup is done, the next thing is to set up swagger for Documentation API.
🌐
GitHub
github.com › qrizan › nestjs-swagger-prisma
GitHub - qrizan/nestjs-swagger-prisma: RESTful API for games catalog application with bookmarking mechanism
RESTful API for games catalog application with bookmarking mechanism - qrizan/nestjs-swagger-prisma
Author   qrizan
Find elsewhere
🌐
GitHub
github.com › prisma › prisma › discussions › 6197
How can one use Prisma with NestJS Swagger annotations? · prisma/prisma · Discussion #6197
NestJS's swagger integration relies on DTO classes to generate types for the API docs. However, prisma generates typescript types rather than classes. And these cannot be annotated. Is there a ...
Author   prisma
🌐
TheQoder's Blog
blog.abdulqudus.com › scalable-rest-api-using-nest
How to Build a REST API with NestJS, Prisma, Swagger, and Docker.
May 12, 2025 - NestJS, a progressive Node.js framework, provides an excellent foundation with its modular, TypeScript-based approach. Combined with Prisma for database operations, Swagger for API documentation, and Docker for containerization, you have a powerful ...
🌐
npm
npmjs.com › package › @brakebein › prisma-generator-nestjs-dto
@brakebein/prisma-generator-nestjs-dto - npm
Generates ConnectDTO, CreateDTO, UpdateDTO, DTO, and Entity classes for models in your Prisma Schema. This is useful if you want to leverage OpenAPI in your NestJS application - but also helps with GraphQL resources as well).
      » npm install @brakebein/prisma-generator-nestjs-dto
    
Published   Jun 18, 2026
Version   1.30.0
🌐
Quokka Labs' Blogs
quokkalabs.hashnode.dev › how-to-build-a-rest-api-with-nestjs-and-prisma
How to Build a REST API with NestJS and Prisma?
May 23, 2023 - You can now see a Swagger UI by navigating to http://localhost:3000/api · Now, we will add Create, Read, Update and Delete operations for the Article model. First, let's generate REST resources ... "What name would you like to use for this resource (plural, e.g., "users")"? The answer is "articles." "What transport layer do you use?" The reply is "REST API." "Would you like to produce CRUD entrance points?" The answer is "Yes." Add PrismaModule as an import to access PrismaCleint in the Article module.
🌐
Prisma
prisma.io › blog › nestjs-prisma-authentication-7D056s1s0k3l
Building a REST API with NestJS and Prisma: Authentication
March 31, 2023 - Learn how to implement JWT authentication in a NestJS REST API with Prisma ORM 7 and Passport: login endpoint, JWT strategy, auth guards, Swagger integration and bcrypt password hashing.
🌐
Medium
medium.com › @tareksaimouah › implementing-sorting-parameters-with-nestjs-prisma-and-swagger-a9837e5bc8e5
Implementing Sorting Parameters With NestJS, Prisma, And Swagger. | by Tarek Saimouah | Medium
March 19, 2024 - A clean and reusable solution for implementing sorting params in a GET API endpoint using NestJS, Prisma and Swagger, utilizing the custom decorators.
🌐
GitHub
github.com › prisma › prisma › issues › 8334
NestJS: Generator for DTOs · Issue #8334 · prisma/prisma
August 17, 2021 - import { Body, Controller, Param, Post, Request } from '@nestjs/common'; import { ApiOperation, ApiTags } from '@nestjs/swagger'; import { CreatePersonSocialMediaDto } from '../dto/create-person-social-media.dto'; import { PersonSocialMediaServicePrisma } from '../services/person-social-media-prisma.service'; @ApiTags('people/{personId}/social-media-prisma') @Controller('people') export class PersonSocialMediaControllerPrisma { constructor(private readonly personSocialMediaService: PersonSocialMediaServicePrisma) {} @Post(':personId/social-media-prisma') @ApiOperation({ summary: 'Adds a new social media record' }) createSocialMedia( @Request() req, @Param('personId') personId: string, @Body() createPersonSocialMediaDto: CreatePersonSocialMediaDto ) { return this.personSocialMediaService.createSocialMedia(personId, req.body, req.user.authDetails); } }
Author   prisma
🌐
npm
npmjs.com › package › prisma-nestjs-graphql-swagger
prisma-nestjs-graphql-swagger - npm
November 6, 2022 - Generate object types, inputs, args, etc. from prisma schema file for usage with @nestjs/graphql module. Latest version: 1.0.6, last published: 4 years ago. Start using prisma-nestjs-graphql-swagger in your project by running `npm i prisma-nestjs-graphql-swagger`. There are no other projects in the npm registry using prisma-nestjs-graphql-swagger.
      » npm install prisma-nestjs-graphql-swagger
    
Published   Nov 06, 2022
Version   1.0.6
🌐
Prisma
prisma.io › blog › nestjs-prisma-relational-data-7D056s1kOabc
Handling Relational Data in a REST API with NestJS and Prisma 7
3 weeks ago - In the first chapter of this series, you created a new NestJS project and integrated it with Prisma ORM, PostgreSQL and Swagger. Then, you built a rudimentary REST API for the backend of a blog application.
🌐
npm
npmjs.com › package › @atlas › nestjs-prisma-gen
@atlas/nestjs-prisma-gen - npm
October 8, 2025 - Generates ConnectDTO, CreateDTO, UpdateDTO, DTO, and Entity classes for models in your Prisma Schema. This is useful if you want to leverage OpenAPI in your NestJS application - but also helps with GraphQL resources as well). NestJS Swagger requires input parameters in controllers to be described ...
      » npm install @atlas/nestjs-prisma-gen
    
Published   Dec 30, 2025
Version   0.3.18
Author   Giorgi Gumburashvili
🌐
Medium
medium.com › @nui_x › building-rest-api-with-nestjs-and-prisma-310c6dd1e641
Building REST API with NestJS and Prisma | by Numentica UI | Medium
August 9, 2024 - In this article we are going to learn about how to build REST API for a CRUD operation. We will get started by creating a new NestJS project. Then we will start your own PostgreSQL server and connect to it using Prisma.
🌐
Prisma
prisma.io › blog › nestjs-prisma-validation-7D056s1kOla1
Input Validation in a REST API with NestJS and Prisma 7
July 19, 2022 - In the first part of this series, you created a new NestJS project and integrated it with Prisma ORM, PostgreSQL and Swagger.