Skip to content

Commit 19fe031

Browse files
fix: reject null and undefined as answer and response values
1 parent 721ca07 commit 19fe031

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/schema.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ import { z } from 'zod'
22

33
export const EvaluationFunctionRequestData = z
44
.object({
5-
answer: z.any(),
6-
response: z.any(),
5+
answer: z.union([z.string(), z.array(z.any()), z.object({}).passthrough()]),
6+
response: z.union([
7+
z.string(),
8+
z.array(z.any()),
9+
z.object({}).passthrough(),
10+
]),
711
params: z.record(z.string(), z.any()),
812
})
913
.strict()

0 commit comments

Comments
 (0)