Open snr-lab opened 1 year ago
You can modify the JSONPath expression to include a space before and after the comma:
concat($.min, " , ", $.max)
(OR)
concat($.min + " , " + $.max)
@yashbalija1 The extra space might create unwanted parsing issues in some scenarios. Apart from that, in my application the JSONPath is user-defined. So there is a high chance of oversight it even though we have quite good documentation.
@snr-lab you can use join([$.min, $.max], ",") this will give you the output as "5,10"
I think this should solve your issue.
@yashbalija1 I don't think there is any json function in jsonpath. Here is the documentation. https://github.com/json-path/JsonPath
yeah, there is no such function @snr-lab You can try this -> concat($.min, ",", $.max)
You can also use a scripting engine like JavaScript inside the JSONPath to achieve this. For example, you can use $.min + ',' + $.max inside the script function of the JSONPath to get the same result.
probably this might work
Hi, When we are trying to concat with a comma the character is getting ignored. For example, my JSON data is { min: 5, max: 10, avg: 7 } and json-path is concat($.min, ",", $.max) The expected result is "5,10" but the actual result is "510"