Skip to content

Commit f7de12b

Browse files
committed
refactor(artifact-graph): adopt zod v4 error message format
Update custom error messages from string format to zod v4 object format using `{ error: 'message' }` convention.
1 parent c73a691 commit f7de12b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/artifact-graph/types.ts

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

33
// Artifact definition schema
44
export const ArtifactSchema = z.object({
5-
id: z.string().min(1, 'Artifact ID is required'),
6-
generates: z.string().min(1, 'generates field is required'),
5+
id: z.string().min(1, { error: 'Artifact ID is required' }),
6+
generates: z.string().min(1, { error: 'generates field is required' }),
77
description: z.string(),
8-
template: z.string().min(1, 'template field is required'),
8+
template: z.string().min(1, { error: 'template field is required' }),
99
requires: z.array(z.string()).default([]),
1010
});
1111

1212
// Full schema YAML structure
1313
export const SchemaYamlSchema = z.object({
14-
name: z.string().min(1, 'Schema name is required'),
15-
version: z.number().int().positive('Version must be a positive integer'),
14+
name: z.string().min(1, { error: 'Schema name is required' }),
15+
version: z.number().int().positive({ error: 'Version must be a positive integer' }),
1616
description: z.string().optional(),
17-
artifacts: z.array(ArtifactSchema).min(1, 'At least one artifact required'),
17+
artifacts: z.array(ArtifactSchema).min(1, { error: 'At least one artifact required' }),
1818
});
1919

2020
// Derived TypeScript types

0 commit comments

Comments
 (0)