Is there any option to use Drizzle InferSelectModel value for annotating swagger response

As you can see in the screenshots, I'm trying to reuse the drizzle infer models for the swagger response Since the infer model is based of type I was not able to annotate it for swagger. Is there any alternative or easiest way to achieve this?
No description
No description
6 Replies
nev the dev
nev the dev3mo ago
i think you need to do typeof before. i could be wrong though
manikandan
manikandanOP3mo ago
that's not the solution
scape
scape3mo ago
It wants the javascript object itself, not the typescript type, you can try putting
import { getTableColumns } from "drizzle-orm";
...
({type: getTableColumns(users)})
import { getTableColumns } from "drizzle-orm";
...
({type: getTableColumns(users)})
manikandan
manikandanOP3mo ago
Again no luck
scape
scape3mo ago
what does it say?
manikandan
manikandanOP3mo ago
No description

Did you find this page helpful?