We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like to be able to achieve this
const myZodSchema = z.object({ property: z.integer().min(5).max(10) property2: z.integer().min(5).max(10) }) const myZodSchemaOnlyCheckType = z.stripKeywords(myZodSchema, ['min', 'max']) // Should return z.object({ property: z.integer() property2: z.integer() })
Is there any way to do that?
I am building an app which uses Drizzle, Zod and Open AI.
On my app, I defined a Drizzle schema and generate a zod schema from it.
import { createInsertSchema } from 'drizzle-zod'; export const profiles = pgTable( 'profiles', { headline: varchar('headline', { length: 255 }).notNull(), }, ); export const insertProfileSchema = createInsertSchema(profiles);
then send the schema over to Open AI to get Structured output.
The generated Zod schema would include the length check. However, OpenAI doesn't support some keyword at the moment, including maxLength. So that's why I am trying to work around this.
length
I've tried with createSelectSchema from drizzle-zod without luck.
createSelectSchema
drizzle-zod
Any other more elegant solutions are welcomed. :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I would like to be able to achieve this
Is there any way to do that?
Some context
I am building an app which uses Drizzle, Zod and Open AI.
On my app, I defined a Drizzle schema and generate a zod schema from it.
then send the schema over to Open AI to get Structured output.
The generated Zod schema would include the
length
check. However, OpenAI doesn't support some keyword at the moment, including maxLength. So that's why I am trying to work around this.I've tried with
createSelectSchema
fromdrizzle-zod
without luck.Any other more elegant solutions are welcomed. :)
The text was updated successfully, but these errors were encountered: