mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 16:44:07 -08:00
wip: disallow unknown fields
This commit is contained in:
parent
d0b080f6e9
commit
5594ff45e1
|
@ -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();
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue