Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix record conversion for Arrays #591

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -434,10 +435,9 @@ private List<Object> decodeArray(String name, Object object, Schema schema) thro
return decodeArray(name, (List) object, schema);
} else if (object instanceof JsonArray) {
return decodeArray(name, (JsonArray) object, schema);
} else {
return decodeArray(name, Collections.singletonList(object), schema);
}
throw new RecordConvertorException(
String.format("Unable to decode array '%s'", name)
);
}

private List<Object> decodeArray(String name, JsonArray list, Schema schema) throws RecordConvertorException {
Expand Down