creating a type based on the input
im getting this error on schema[col.id]
1 Reply
You need to use the setKey method.
const schema = someData.reduce(
(schema, definition) => schema.setKey(definition.name, z.string()),
z.object({})
);