JOLT 转换合并对象数组

JOLT Transformation Merge Array of Objects

我正在尝试为以下输入创建颠簸转换;

{
"group1": [
    {
        "schema": "schemaA"
    },
    {
        "key1": "val1",
        "key2": "val2"
    }
],
"group2": [
    {
        "schema": "schemaA"
    },
    {
        "key1": "val1",
        "key2": "val2"
    }
]}

具有所需的输出;

{
"group1": {
    "schema": "schemaA",
    "key1": "val1",
    "key2": "val2"
},
"group2": {
    "schema": "schemaA",
    "key1": "val1",
    "key2": "val2"
}}

密钥 'schema' 将始终存在,但我不知道密钥 1、密钥 2 等值是什么。所以我无法明确映射它们。任何帮助将不胜感激!

规格,

[
  {
    "operation": "shift",
    "spec": {
      "group*": {
        "*": {
          "key*": "&2.&",
          "schema": "&2.&"
        }
      }
    }
  }
]