How to prevent JSLT removing null & empty properties #235
cvsudheer108
started this conversation in
General
Replies: 3 comments 4 replies
|
The example is for when you're using the JSLT API directly. If you're working through Camel you need to see how Camel supports it. I guess it's entirely possible you need to add it to Camel yourself. My guess is it's really easy to solve that. |
1 reply
|
Hey @larsga what is Reader reader = new Reader() {
@Override
public int read(char[] cbuf, int off, int len) throws IOException {
return 0;
}
@Override
public void close() throws IOException {
}
};
Expression jslt = new Parser(reader)
.withObjectFilter("true")
.compileString(convertModel.getJsltTemplate());
JsonNode output = jslt.apply(convertModel.getJsonInput());It is not working for me. Can you please help me out |
0 replies
|
|
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi JSLT Team,
I found an a documentation related to this, to use Object Key Filter to prevent this from happening.
https://github.com/schibsted/jslt/blob/master/docs/api.md#object-key-filter
But I am not sure where to put this code:
Expression e = new Parser(reader)
.withObjectFilter(filter)
.parse();
Moreover, I am using Camel to invoke the JSLT transform.
Please throw some light on implementing this.
All reactions