mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-17 01:42:43 -05:00
fix(resolver): json/array field parsing (#2074)
* fix(resolver): json/array field parsing * remove comment
This commit is contained in:
committed by
GitHub
parent
4d5c574363
commit
472aff5dd7
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user