Skip to content

Commit 96f9f31

Browse files
committed
fix: allow arrays of all supported types in getSanitizedValues
1 parent 867ee57 commit 96f9f31

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

components/abstractions/src/main/java/com/microsoft/kiota/RequestInformation.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,14 @@ private static Object getSanitizedValues(Object value) {
462462
return null;
463463
}
464464
if (value.getClass().isArray()) {
465-
if (((Object[]) value).length > 0 && ((Object[]) value)[0] instanceof ValuedEnum) {
465+
if (((Object[]) value).length > 0) {
466+
if (((Object[]) value)[0].getClass().isArray()) {
467+
throw new IllegalArgumentException("multidimensional arrays are not supported");
468+
}
469+
466470
final ArrayList<String> result = new ArrayList<>();
467471
for (final Object item : (Object[]) value) {
468-
result.add(((ValuedEnum) item).getValue());
472+
result.add(getSanitizedValues(item).toString());
469473
}
470474
return result;
471475
}

0 commit comments

Comments
 (0)