We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 97093fc + 18a68b1 commit c834d2fCopy full SHA for c834d2f
src/test/java/com/datadog/api/World.java
@@ -681,7 +681,17 @@ public static Object lookup(Object data, String path)
681
}
682
if (part.contains("]")) {
683
int index = Integer.parseInt(part.replaceAll("]", ""));
684
- result = List.class.cast(result).get(index);
+ // Unwrap oneOf wrapper before indexing into array
685
+ try {
686
+ result = List.class.cast(result).get(index);
687
+ } catch (ClassCastException e) {
688
689
+ Object unwrapped = result.getClass().getMethod("getActualInstance").invoke(result);
690
+ result = List.class.cast(unwrapped).get(index);
691
+ } catch (Exception ex) {
692
+ throw e;
693
+ }
694
695
} else {
696
try {
697
result = HashMap.class.cast(result).get(part);
0 commit comments