fix(resolver): json/array field parsing (#2074)

* fix(resolver): json/array field parsing

* remove comment
This commit is contained in:
Vikhyath Mondreti
2025-11-20 00:27:12 -08:00
committed by GitHub
parent 4d5c574363
commit 472aff5dd7
12 changed files with 45 additions and 80 deletions

View File

@@ -42,6 +42,24 @@ export class GenericBlockHandler implements BlockHandler {
})
}
}
if (blockConfig?.inputs) {
for (const [key, inputSchema] of Object.entries(blockConfig.inputs)) {
const value = finalInputs[key]
if (typeof value === 'string' && value.trim().length > 0) {
const inputType = typeof inputSchema === 'object' ? inputSchema.type : inputSchema
if (inputType === 'json' || inputType === 'array') {
try {
finalInputs[key] = JSON.parse(value.trim())
} catch (error) {
logger.warn(`Failed to parse ${inputType} field "${key}":`, {
error: error instanceof Error ? error.message : String(error),
})
}
}
}
}
}
}
try {