Add support for array type in Generate variables actions

Closes #1870
This commit is contained in:
Baptiste Arnaud 2025-07-07 16:13:19 +02:00
parent 96ec9ef44d
commit de7f96ac0c
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View File

@ -37,6 +37,11 @@ export const variablesToExtractSchema = option
type: option.literal("boolean"),
})
.extend(extractInfoBaseShape),
option
.object({
type: option.literal("array"),
})
.extend(extractInfoBaseShape),
option
.object({
type: option.literal("enum"),

View File

@ -85,6 +85,9 @@ const convertVariablesToExtractToSchema = ({
case "boolean":
shape[matchingVariable.name] = z.boolean();
break;
case "array":
shape[matchingVariable.name] = z.array(z.string());
break;
case "enum": {
if (!variableToExtract.values || variableToExtract.values.length === 0)
return;