Implementation of Drizzle and tsoa
Hello, I am trying implementing Drizzle but I also want to implement tsoa for auto generating documentation. Do you guys have any idea how to make the model schema with tsoa annotations?
https://tsoa-community.github.io/docs/descriptions.html
Descriptions | tsoa
A VitePress site
3 Replies
right now here is my code, how do I give descriptions for the Model and each of the columns?
I think you should create an issue on GH with link to this thread and we'll have a look when we have time
doesn't seem like a quick solution
I was curious if an issue ever got created, so that I could follow it. I am also lookin into how to update descriptions, but I'm having another problem to and was curious if @rizaldiariif had encountered it since they're using tsoa.
When I do the following
export type UserDbType = typeof user.$inferSelect
then in a separate models packing in my monorepo, I do export type User = Pick<UserDbType, 'id', 'email'>
tsoa generates my swagger documentation.
But if I change the model to be export type User = UserDbType
I get an error when generating the documentation that says
Have you ever had that problem?
Actually my issue appears to be between TSOA and Zod, https://github.com/lukeautry/tsoa/issues/1256GitHub
Support zod's infer type · Issue #1256 · lukeautry/tsoa
When using a Zod validator and then passing it to TSOA, it throws this error: Error: No matching model found for referenced type infer. Types File export const MyValidator = z.object({ result: z.ob...