diff --git a/packages/cli/src/evaluation/test-definition.schema.ts b/packages/cli/src/evaluation/test-definition.schema.ts index 606233bcdd..ffb6d82ab5 100644 --- a/packages/cli/src/evaluation/test-definition.schema.ts +++ b/packages/cli/src/evaluation/test-definition.schema.ts @@ -1,13 +1,17 @@ import { z } from 'zod'; -export const testDefinitionCreateRequestBodySchema = z.object({ - name: z.string().min(1).max(255), - workflowId: z.string().min(1), - evaluationWorkflowId: z.string().min(1).optional(), -}); +export const testDefinitionCreateRequestBodySchema = z + .object({ + name: z.string().min(1).max(255), + workflowId: z.string().min(1), + evaluationWorkflowId: z.string().min(1).optional(), + }) + .strict(); -export const testDefinitionPatchRequestBodySchema = z.object({ - name: z.string().min(1).max(255).optional(), - evaluationWorkflowId: z.string().min(1).optional(), - annotationTagId: z.string().min(1).optional(), -}); +export const testDefinitionPatchRequestBodySchema = z + .object({ + name: z.string().min(1).max(255).optional(), + evaluationWorkflowId: z.string().min(1).optional(), + annotationTagId: z.string().min(1).optional(), + }) + .strict(); diff --git a/packages/cli/src/evaluation/test-definition.service.ee.ts b/packages/cli/src/evaluation/test-definition.service.ee.ts index ad96744ed9..18055f32bc 100644 --- a/packages/cli/src/evaluation/test-definition.service.ee.ts +++ b/packages/cli/src/evaluation/test-definition.service.ee.ts @@ -89,11 +89,6 @@ export class TestDefinitionService { await validateEntity(updatedTest); } - // Do not allow updating the workflow ID after test definition creation - if (attrs.workflowId) { - delete attrs.workflowId; - } - // Check if the annotation tag exists if (attrs.annotationTagId) { const annotationTagExists = await this.annotationTagRepository.exists({