-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Expected Behaviour
When using the zodSchema function, it should generate a zod agnostic mongoose schema.
Current Behaviour
When using the zodSchema function, it generates a mongoose Schema of which its raw type is still the zod schema types.
Context
Lines 50 to 55 in 506bc0e
| export function zodSchema<T extends ZodRawShape>( | |
| schema: ZodObject<T>, | |
| ): Schema<T> { | |
| const definition = parseObject(schema); | |
| return new Schema<T>(definition); | |
| } |
Possible Solution
export function zodSchema<T extends AnyZodObject>(
schema: T
): Schema<z.infer<T>> {
const definition = parseObject(schema);
return new Schema(definition);
}Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers