Skip to content

Commit 124272c

Browse files
committed
fix(core): remove the dynamic property patterns
1 parent 65dd4f9 commit 124272c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

core/src/main/java/io/kestra/core/docs/JsonSchemaGenerator.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,12 @@ public CustomDefinition provideCustomSchemaDefinition(ResolvedType javaType, Sch
311311
if (member.getDeclaredType().isInstanceOf(Property.class)) {
312312
memberAttributes.put("$dynamic", true);
313313
// if we are in the String definition of a Property but the target type is not String: we configure the pattern
314-
Class<?> targetType = member.getDeclaredType().getTypeParameters().getFirst().getErasedType();
315-
if (!String.class.isAssignableFrom(targetType) && String.class.isAssignableFrom(member.getType().getErasedType())) {
316-
memberAttributes.put("pattern", ".*{{.*}}.*");
317-
}
314+
// TODO this was a good idea but their is too much cases where it didn't work like in List or Map so if we want it we need to make it more clever
315+
// I keep it for now commented but at some point we may want to re-do and improve it or remove these commented lines
316+
// Class<?> targetType = member.getDeclaredType().getTypeParameters().getFirst().getErasedType();
317+
// if (!String.class.isAssignableFrom(targetType) && String.class.isAssignableFrom(member.getType().getErasedType())) {
318+
// memberAttributes.put("pattern", ".*{{.*}}.*");
319+
// }
318320
} else if (member.getDeclaredType().isInstanceOf(Data.class)) {
319321
memberAttributes.put("$dynamic", false);
320322
}

0 commit comments

Comments
 (0)