代码之家  ›  专栏  ›  技术社区  ›  Manish Mehndiratta

JSON转换的jolt规范

  •  0
  • Manish Mehndiratta  · 技术社区  · 7 年前

    需要帮助了解如何将JSON从共享输入格式转换为预期格式的JOLT规范。

    输入JSON:

    {
      "DataModel": {
        "Header": {
          "TMS_ID": "2030617701",
          "PROCESS_CD": "WvWellHeader",
          "BATCH_ID": "30772",
          "RECORD_COUNT": "1",
          "SOURCE_SYSTEM": "WELLVIEW",
          "SOURCE_RECORD_ID": "2030617701",
          "TARGET_SYSTEM": "EDW",
          "TRANSACTION_TYPE": "NEW",
          "SOURCE_CREATE_DATE": "2017-03-29T10:18:00-05:00",
          "KEY": {
            "ELEMENT_NAME": "KEY_PAIRS",
            "ELEMENT_VALUE": "WvWellHeader?Idrec=7052A964B7EB45D684CC3849E3ED5848"
          },
          "DELETE_FL": "N"
        },
        "Data": "H4sIAAAAAAAAA42UXW+bMBSGr7dfYWnSAA=="
      }
    }
    

    应为JSON

    {
        "TMS_ID" :"2030617701",
        "PROCESS_CD" :"WvWellHeader",
        "BATCH_ID" :"30772",
        "SOURCE_SYSTEM" :"WELLVIEW",
        "SOURCE_RECORD_ID" :"2030617701",
        "ELEMENT_VALUE" :"WvWellHeader?Idrec=7052A964B7EB45D684CC3849E3ED5848",
        "DELETE_FL" :"N",
        "Data" : "HH4sIAAAAAAAAA42UXW+bMBSGr7dfYWnSAA=="
    }
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Milo S    7 年前

    规格,让你开始

    [
      {
        "operation": "shift",
        "spec": {
          "DataModel": {
            "Header": {
              "TMS_ID": "TMS_ID",
              "KEY": {
                "ELEMENT_VALUE": "ELEMENT_VALUE"
              }
            }
          }
        }
      }
    ]
    

    生产

    {
      "TMS_ID" : "2030617701",
      "ELEMENT_VALUE" : "WvWellHeader?Idrec=7052A964B7EB45D684CC3849E3ED5848"
    }
    

    运行时间 http://jolt-demo.appspot.com 并阅读/播放示例。