You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JsonItemReaderBuilder should not substitute null resource with ByteArrayResource #5234
JsonItemReaderBuilder should not replace a nullresource with an empty ByteArrayResource. It should align with the “resource can be injected later” pattern used with FlatFileItemReader, especially when the reader is used as a delegate of MultiResourceItemReader.
if (this.resource == null) {
logger.debug("The resource is null. This is only a valid scenario when "
+ "injecting it later as in when using the MultiResourceItemReader");
}
JsonItemReader<T> reader = newJsonItemReader<>(this.jsonObjectReader);
reader.setResource(this.resource);
returnreader;
Current Behavior
When resource == null, the builder replaces it with an empty ByteArrayResource and creates the reader with that placeholder.
Keep the resource null in the builder and let the reader validate it at doOpen time (as FlatFileItemReader does), instead of inserting an empty placeholder resource.
Activity
Avoid ByteArrayResource fallback when JsonItemReaderBuilder resource …