Skip to content

Trouble with defining schema #444

Closed Answered by rpurinton
rpurinton asked this question in Q&A
Discussion options

You must be logged in to vote

resolved.

the problem is here:

const schema = z.object({
  tasks: z.array(taskSchema).min(1).describe('Array of tasks to create.'),
});

change to

const schema = {
  tasks: z.array(taskSchema).min(1).describe('Array of tasks to create.'),
};

Ie: no outer z.object wrapper

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rpurinton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant