@@ -2,19 +2,19 @@ import { z } from 'zod';
22
33// Artifact definition schema
44export 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
1313export 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