1 Reply
You need to use the setKey method.
const schema = someData.reduce(
(schema, definition) => schema.setKey(definition.name, z.string()),
z.object({})
);