You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, define a generic type that describes the structure of the config. This type should be flexible to handle arbitrary nesting and the special '*' wildcard for applying transformations to all children of a level:
Function Signature:
Implement transformSchema with these types:
functiontransformSchema<Textendsz.ZodObject<any>,CextendsTransformConfig<z.infer<T>>>(schema: T,config: C): z.ZodObject<TransformSchema<z.infer<T>,C>>{// Implementation would involve recursively walking through the schema // and altering the options based on config. This part is simplified:returnschemaasany;// Placeholder for actual transformation logic}
Instead of solving this, it also make sense to let the user overwrite type-hints matching config overwrites (prone to human errors if the config overwrites are complex).
Tasks
Main: type hinting transformSchema
It is dynamic and nested and new schema updated based config
Approach
Begin with Grok
First, define a generic type that describes the structure of the config. This type should be flexible to handle arbitrary nesting and the special '*' wildcard for applying transformations to all children of a level:
Now, create a type that can transform the schema based on the configuration:
Implement transformSchema with these types:
Grok
Fine tune with Claude (free version)
Still didn't solve the problem and nested object still optional
Claude:
Local attempt with simple type hints:
The text was updated successfully, but these errors were encountered: