skip to Main Content

evaluate JSON expression in child object

I am trying to evaluate json expression using Josson, but it gives invalid function error String json ="{"data":{"B":"calc(348+(96*$.SelectedPump.stg*$.ModelMaster.count))"},"SelectedPump":{"stg":10,"ab":200},"ModelMaster":{"count":20}}"; Josson josson = Josson.fromJsonString(json.toString()); System.out.println(josson.getNode("data.eval(B)")); Stacktrace: Exception in thread "main" java.lang.IllegalArgumentException: Invalid function call eval() : Invalid function call calc() : Calc…

VIEW QUESTION

Better way of writing validation for a JSON String

I have a JSON String: { "productName": "Gold", "offerStartDate": "01152023", "offerEndDate": "01152024", "offerAttributes": [ { "id": "TGH-DAD3KVF3", "storeid": "STG-67925", "availability": true } ], "offerSpecifications": { "price": 23.25 } } The validation logic for the same is written as Map<String, Object>…

VIEW QUESTION

Convert CSV with nested JSON object to JSON

I have a sample CSV message: header1,header2,header3 value1,value2,{"name":"John","age":30,"car":null} How to convert it in form of embedded JSON as in: { "header1": "value1", "header2": "value2", "header3": "{"name":"John","age":30,"car":null}" } I am using Jackson schema builder with default column separator: CsvSchema.builder().disableQuoteChar().setUseHeader(true).build(); CsvMapper.builder().enable(CsvParser.Feature.IGNORE_TRAILING_UNMAPPABLE, CsvParser.Feature.WRAP_AS_ARRAY).build();

VIEW QUESTION
Back To Top
Search