JSON to JSON transformer

后端 未结 7 2089
醉话见心
醉话见心 2020-11-30 03:36

I got a scenario.

Required input and output are JSON.

// Input
{
  \"OldObject\": {
    \"Time\": 1351         


        
7条回答
  •  囚心锁ツ
    2020-11-30 03:44

    Try JOLT. It is a JSON to JSON transformation library written in Java. It was created on a project that was transforming lot of JSON from an ElasticSearch "backend" to a frontend api.

    For the JSON transform you have listed in your problem, the Jolt "shift" spec would be :

    // Jolt "shift" spec
    {
        "OldObject": {
            "Time": "NewObject.Time",   
            "Name": "NewObject.Title", // if the input has "OldObject.Name", copy it's value
                                       // to "NewObject.Title
            "quantity": "NewObject.quantity"
        }
    }
    

提交回复
热议问题