java-jq
java-jq copied to clipboard
Unable to work with empty input
JQ can be ran without input, say to use template to construct output out of nothing. Say that you pass parameter, and base on this parameter (this isn't probably supported yet) there will be array of N items generated.
But passing null is not supported and catched here:
com.arakelian.jq.ImmutableJqRequest.Builder#input
and passing empty string will fail later on here:
com.arakelian.jq.JqRequest#parse(com.sun.jna.Pointer, com.sun.jna.Pointer, java.lang.String, com.arakelian.jq.ImmutableJqResponse.Builder)
in memory instantiation:
final Memory memory = new Memory(input.length);
memory.write(0, input, 0, input.length);
My usecase is very simple, I'm writing just some helper tool, so I can bypass it (still via some unconvenient ways), but it would be great it this can be supported.