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 dev2mo ago
i think you need to do typeof before. i could be wrong though
manikandan
manikandanOP2mo ago
that's not the solution
scape
scape2mo 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
manikandanOP2mo ago
Again no luck
scape
scape2mo ago
what does it say?
manikandan
manikandanOP2mo ago
No description

Did you find this page helpful?