Skip to content

add toList to JsonUtils#7583

Closed
walterddr wants to merge 1 commit intoapache:masterfrom
walterddr:add_jsonutil
Closed

add toList to JsonUtils#7583
walterddr wants to merge 1 commit intoapache:masterfrom
walterddr:add_jsonutil

Conversation

@walterddr
Copy link
Contributor

@walterddr walterddr commented Oct 15, 2021

there's no JsonUtils.toList for String or InputStream or byte[] input type, only for File. Adding the other 3

return DEFAULT_READER.forType(valueTypeRef).readValue(jsonString);
}

public static <T> List<T> stringToList(String jsonString, Class<T> valueType)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont know where to add test the best, it doesn't seem like the others are tested individually either.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really think these should be tested though. If all new code is tested, coverage can't get worse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good. I take this as ok to create a separate test file entirely to cover the non-tested JsonUtils functions. will do it soon

@walterddr
Copy link
Contributor Author

actually closing this. I think we should directly use/test the TypeReference<..> API. for now my need is satistified with the typereference API

@walterddr walterddr closed this Oct 18, 2021
@walterddr walterddr deleted the add_jsonutil branch December 6, 2023 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants