fix(blocks): add json_schema_extra for images field to prevent frontend crash

When clicking '+ Item' on the Images input field, the frontend was crashing with:
TypeError: Cannot read properties of undefined (reading 'type')

This was caused by the frontend not being able to determine what type of items
to add to the Optional[List[MediaFileType]] array. Added explicit JSON schema
with array type and string items with URI format to provide the frontend with
the necessary type information.

Co-authored-by: Bently <Bentlybro@users.noreply.github.com>
This commit is contained in:
claude[bot]
2025-09-04 14:51:02 +00:00
parent 4603565782
commit f9d21138e8

View File

@@ -64,6 +64,10 @@ class AIImageCustomizerBlock(Block):
description="List of input images (optional)",
default=None,
title="Images",
json_schema_extra={
"type": "array",
"items": {"type": "string", "format": "uri"},
},
)
output_format: OutputFormat = SchemaField(
description="Format of the output image",