Question

Convert a JSON string to JSON

  • 20 June 2022
  • 1 reply
  • 97 views

I am reading from Kafka in text format (as JSON format not supported) and trying to convert the JSON string into an actual JSON for flattening and pivoting. My sample data looks like below.

{"text":"\d0000\d0000\d0000\d00007{\"Employee\":{\"Address\":[{\"Addressid\":\"3897ef\"}],\"Role\":{\"Designation\":{\"name\":\"Manager\"}}}

 

I want to convert as follows

{
    "Employee": {
        "Address": [
            {
                "Addressid": "3897ef"
            }
        ],
        "Role": {
            "Designation": {
                "name": "Manager"
            }
        },
}

 

How can I covert this into a list map JSON hierarchy as above?


1 reply

Userlevel 5
Badge +1

@ana00159 

can you please provide the correct sample data ,so i can give a try to convert into actual json.

Reply