You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Prisma as ORM service. Prisma provides its own schema for the model. Of course I want to use this model in the api interface. Unfortunately this is not recognized as is present just as "string".
Is it possible to use the Prisma model with tsoa?
user-controller.ts
import {User} from "@prisma/client";
import {Body, Controller, Example, Get, Post, Put, Route, SuccessResponse, Tags} from "tsoa";
@Route("user")
@Tags('user')
export class UserController extends Controller {
@Post()
@SuccessResponse("201", "Created")
public async create(@Body() user: User): Promise<User> {
}
}
prisma.schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
email String @unique @map("_email")
}
The text was updated successfully, but these errors were encountered:
I use Prisma as ORM service. Prisma provides its own schema for the model. Of course I want to use this model in the api interface. Unfortunately this is not recognized as is present just as "string".
Is it possible to use the Prisma model with tsoa?
user-controller.ts
prisma.schema
The text was updated successfully, but these errors were encountered: