Skip to content

Commit 2ac0897

Browse files
monikakusterivicac
authored andcommitted
1575 - fix - options not loaded in items within array
1 parent f6db198 commit 2ac0897

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

server/libs/platform/platform-component/platform-component-service/src/main/java/com/bytechef/platform/component/ComponentDefinitionRegistry.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,19 @@ private static Property getProperty(
290290
List<String> subProperties = Arrays.asList(propertyName.split("\\."));
291291

292292
if (subProperties.size() == 1) {
293-
return CollectionUtils.getFirst(properties, property -> Objects.equals(propertyName, property.getName()));
293+
if (propertyName.endsWith("]")) {
294+
Property.ArrayProperty arrayProperty = (Property.ArrayProperty) CollectionUtils.getFirst(
295+
properties,
296+
curProperty -> Objects.equals(
297+
curProperty.getName(), propertyName.substring(0, propertyName.length() - 3)));
298+
299+
List<? extends Property> items = OptionalUtils.get(arrayProperty.getItems());
300+
301+
return items.getFirst();
302+
} else {
303+
return CollectionUtils.getFirst(properties,
304+
property -> Objects.equals(propertyName, property.getName()));
305+
}
294306
} else {
295307
Property firstProperty = CollectionUtils.getFirst(
296308
properties, property -> Objects.equals(property.getName(), subProperties.getFirst()));

0 commit comments

Comments
 (0)