I have a requirement to transform the Nested Object in a Json structure.
Here's the Input JSON
Input JSON
{
"data": {
"PRODUCTS": {
"ProductID": "1234-5678",
"ModelNumber": "B550",
"Price": "199",
"Quantity": "1",
"ATTRIBUTES": {
"ProductID": "1234-5678",
"Height": "25",
"Width": "75"
}
}
}
}
Required Output
{
"data": {
"products": [
{
"productId": "1234-5678",
"modelNumber": "B550",
"unitPrice": "199",
"quantity": "1",
"attributes": [
{
"productId": "1234-5678",
"height": "25",
"width": "75"
}
]
}
]
}
}
My JSON Spec:
[
{
"operation": "modify-overwrite-beta",
"spec": {
"data": {
"PRODUCTS": "=toList"
}
}
},
{
"operation": "shift",
"spec": {
"data": {
"PRODUCTS": {
"*": {
"ProductID": "data.products[&1].productId",
"ModelNumber": "data.products[&1].modelNumber",
"Price": "data.products[&1].unitPrice",
"Quantity": "data.products[&1].quantity",
"ATTRIBUTES": {
"ProductID": "data.products[&1].attributes[&1].productId",
"Height": "data.products[&1].attributes[&1].height",
"Width": "data.products[&1].attributes[&1].width"
}
}
}
}
}
},
{
"operation": "default",
"spec": {
"data": {
"*": {}
}
}
}
]
Current Output
{
"data" : {
"products" : [ {
"productId" : "1234-5678",
"modelNumber" : "B550",
"unitPrice" : "199",
"quantity" : "1"
} ]
}
}
I want to convert the ATTRIBUTES nested object to a list and also the nodes inside the ATTRIBUTES object as per the expected output. Can someone throw some light as to how can I achieve this?
You can apply three steps of shift transformations;
To rename all keys as desired
To create the innermost array (attributes)
To create the outermost array (products)
such as
[
{
"operation": "shift",
"spec": {
"data": {
"*": {
"ProductID": "&2.products.productID",
"ModelNumber": "&2.products.modelNumber",
"Price": "&2.products.unitPrice",
"Quantity": "&2.products.quantity",
"*": {
"ProductID": "&3.products.attributes.productId",
"Height": "&3.products.attributes.height",
"Width": "&3.products.attributes.width"
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"attributes": "&2.&1.&[]",
"*": "&2.&1.&"
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": "&1.&[]"
}
}
}
]
Related
I have a complex Json where i wanted to flatten the Json using Jolt or any other ways to flatten in Nifi is also fine
can anyone please help to flatten the below JSON
{
"veread": "ndjdjjywuieopppqpppwaghhzuii",
"debittanceInformation": [
{
"internalDocumentInformation": [
{
"number": "8",
"lineDetails": [
{
"identifications": [
{
"number": "44",
"model": {
"code": "xdd",
"proprietary": "ddy"
},
"relatedDate": "3/4"
}
],
"quantity": 136,
"unitOfMeasure": "each",
"money": {
"duePayablemoney": 44,
"discountAppliedmoneys": [
{
"model": {
"code": "dddddd",
"proprietary": "rddddy"
},
"money": 216.2
}
],
"valuemoneys": [
{
"model": {
"code": "ddddd",
"proprietary": "dddd"
},
"money": 391.41
}
],
"adjustmentmoneyAndReasons": [
{
"money": 824.54,
"reason": "dd"
}
],
"debittedmoney": 660.7,
"creditNotemoney": 985.63
}
}
],
"internalDocumentmoney": {
"duePayablemoney": 567.45,
"discountAppliedmoneys": [
{
"model": {
"code": "DD",
"proprietary": "EE"
},
"money": 5.64
}
],
"valuemoneys": [
{
"model": {
"code": "z",
"proprietary": "a"
},
"money": 145
}
],
"adjustmentmoneyAndReasons": [
{
"money": 678,
"reason": "tyuiop"
}
],
"debittedmoney": 123,
"creditNotemoney": 456
}
}
],
"supplierReferenceInformation": {
"model": {
"code": "x",
"proprietary": "y"
},
"issuer": "issuer",
"reference": "hfhjfdozkdfl;fdko;k"
},
"billr": {
"name": "jdjaiofjiosJOfjaiodjoiwaj",
"companyIdentifications": [
{
"identification": "74747435438",
"model": "jdidfjdsjf"
}
]
},
"bille": {
"name": "djhsaijdwjadfja;dddF",
"companyIdentifications": [
{
"identification": "dddddd",
"model": "kksjdadawx"
}
]
},
"additionaldebittanceInformation": [
"dd",
"xnjasndfjafnlkNDflkhlfkacmakjhfncasklnf"
]
}
],
"chargesInformation": []
}
The above is My Json which I need to flatten in to simple JSON so that I can process it in Hive .
i have tried using Flatten JSON processor but it is not working so now I an trying using jolt spec
can any one please guide me with above issue using either Jolt transformation or in Nifi.
my expected output should be as below
{
"veread": "ndjdjjywuieopppqpppwaghhzuii",
"ddddwww_internalDocumentInformation_number": "8",
"ddddwww_internalDocumentInformation_lineDetails_identifications_number": "1025",
"ddddwww_internalDocumentInformation_lineDetails_identifications_model.code": "x",
"ddddwww_internalDocumentInformation_lineDetails_identifications_model.proprietary": "y",
"ddddwww_internalDocumentInformation_lineDetails_identifications_relatedDate": "3/23",
"ddddwww_internalDocumentInformation_lineDetails_quantity": 136,
"ddddwww_internalDocumentInformation_lineDetails_unitOfMeasure": "each",
"ddddwww_internalDocumentInformation_lineDetails_money.duePayablemoney": 957.86,
"ddddwww_internalDocumentInformation_lineDetails_money.discountAppliedmoneys_model.code": "dvbnqwe",
"ddddwww_internalDocumentInformation_lineDetails_money.discountAppliedmoneys_model.proprietary": "rqazloy",
"ddddwww_internalDocumentInformation_lineDetails_money.discountAppliedmoneys_money": 216.2,
"ddddwww_internalDocumentInformation_lineDetails_money.valuemoneys_model.code": "YUIO",
"ddddwww_internalDocumentInformation_lineDetails_money.valuemoneys_model.proprietary": "BHRTY",
"ddddwww_internalDocumentInformation_lineDetails_money.valuemoneys_money": 391.41,
"ddddwww_internalDocumentInformation_lineDetails_money.adjustmentmoneyAndReasons_money": 824.54,
"ddddwww_internalDocumentInformation_lineDetails_money.adjustmentmoneyAndReasons_reason": "BONUS",
"ddddwww_internalDocumentInformation_lineDetails_money.debittedmoney": 660.7,
"ddddwww_internalDocumentInformation_lineDetails_money.creditNotemoney": 985.63,
"ddddwww_internalDocumentInformation_internalDocumentmoney.duePayablemoney": 567.45,
"ddddwww_internalDocumentInformation_internalDocumentmoney.discountAppliedmoneys_model.code": "DD",
"ddddwww_internalDocumentInformation_internalDocumentmoney.discountAppliedmoneys_model.proprietary": "EE",
"ddddwww_internalDocumentInformation_internalDocumentmoney.discountAppliedmoneys_money": 5.64,
"ddddwww_internalDocumentInformation_internalDocumentmoney.valuemoneys_model.code": "z",
"ddddwww_internalDocumentInformation_internalDocumentmoney.valuemoneys_model.proprietary": "a",
"ddddwww_internalDocumentInformation_internalDocumentmoney.valuemoneys_money": 145,
"ddddwww_internalDocumentInformation_internalDocumentmoney.adjustmentmoneyAndReasons_money": 678,
"ddddwww_internalDocumentInformation_internalDocumentmoney.adjustmentmoneyAndReasons_reason": "tyuiop",
"ddddwww_internalDocumentInformation_internalDocumentmoney.debittedmoney": 123,
"ddddwww_internalDocumentInformation_internalDocumentmoney.creditNotemoney": 456,
"ddddwww_supplierReferenceInformation.model.code": "x",
"ddddwww_supplierReferenceInformation.model.proprietary": "y",
"ddddwww_supplierReferenceInformation.issuer": "issuer",
"ddddwww_supplierReferenceInformation.reference": "hfhjfdozkdfl;fdko;k",
"ddddwww_billr.name": "jdjaiofjiosJOfjaiodjoiwaj",
"ddddwww_billr.companyIdentifications_identification": "74747435438",
"ddddwww_billr.companyIdentifications_model": "jdidfjdsjf",
"ddddwww_bille.name": "djhsaijdwjadfja;lMEjknEAKDLJOJRF",
"ddddwww_bille.companyIdentifications_identification": "mkskfsajdwiojdijRUWa",
"ddddwww_bille.companyIdentifications_model": "kksjdadawx",
"ddddwww_additionalddddwww[0]": "JDSJAHDJKLJHRFQWJESJqiorwjd",
"ddddwww_additionalddddwww[1]": "xnjasndfjafnlkNDflkhlfkacmakjhfncasklnf",
"chargesInformation": []
}
I have updated the request
Use FlattenJson processor with properties:
Separator: _
Flatten Mode: normal
Output json:
{
"transactionId" : "ndjdjjywuieopppqpppwaghhzuii",
"debittanceInformation[0]_internalDocumentInformation[0]_number" : "8",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_identifications[0]_number" : "1025",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_identifications[0]_model_code" : "x",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_identifications[0]_model_proprietary" : "y",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_identifications[0]_relatedDate" : "3\/23",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_quantity" : 136,
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_unitOfMeasure" : "each",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_duePayablemoney" : 957.86,
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_discountAppliedmoneys[0]_model_code" : "dvbnqwe",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_discountAppliedmoneys[0]_model_proprietary" : "rqazloy",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_discountAppliedmoneys[0]_money" : 216.2,
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_valuemoneys[0]_model_code" : "YUIO",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_valuemoneys[0]_model_proprietary" : "BHRTY",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_valuemoneys[0]_money" : 391.41,
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_adjustmentmoneyAndReasons[0]_money" : 824.54,
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_adjustmentmoneyAndReasons[0]_reason" : "BONUS",
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_debittedmoney" : 660.7,
"debittanceInformation[0]_internalDocumentInformation[0]_lineDetails[0]_money_creditNotemoney" : 985.63,
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_duePayablemoney" : 567.45,
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_discountAppliedmoneys[0]_model_code" : "DD",
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_discountAppliedmoneys[0]_model_proprietary" : "EE",
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_discountAppliedmoneys[0]_money" : 5.64,
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_valuemoneys[0]_model_code" : "z",
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_valuemoneys[0]_model_proprietary" : "a",
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_valuemoneys[0]_money" : 145,
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_adjustmentmoneyAndReasons[0]_money" : 678,
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_adjustmentmoneyAndReasons[0]_reason" : "tyuiop",
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_debittedmoney" : 123,
"debittanceInformation[0]_internalDocumentInformation[0]_internalDocumentmoney_creditNotemoney" : 456,
"debittanceInformation[0]_supplierReferenceInformation_model_code" : "x",
"debittanceInformation[0]_supplierReferenceInformation_model_proprietary" : "y",
"debittanceInformation[0]_supplierReferenceInformation_issuer" : "issuer",
"debittanceInformation[0]_supplierReferenceInformation_reference" : "hfhjfdozkdfl;fdko;k",
"debittanceInformation[0]_billr_name" : "jdjaiofjiosJOfjaiodjoiwaj",
"debittanceInformation[0]_billr_companyIdentifications[0]_identification" : "74747435438",
"debittanceInformation[0]_billr_companyIdentifications[0]_model" : "jdidfjdsjf",
"debittanceInformation[0]_bille_name" : "djhsaijdwjadfja;lMEjknEAKDLJOJRF",
"debittanceInformation[0]_bille_companyIdentifications[0]_identification" : "mkskfsajdwiojdijRUWa",
"debittanceInformation[0]_bille_companyIdentifications[0]_model" : "kksjdadawx",
"debittanceInformation[0]_additionaldebittanceInformation[0]" : "JDSJAHDJKLJHRFQWJESJqiorwjd",
"debittanceInformation[0]_additionaldebittanceInformation[1]" : "xnjasndfjafnlkNDflkhlfkacmakjhfncasklnf",
"chargesInformation" : [ ]
}
You can use the shift transformation below in a JoltTransformJSON processor
[
{
"operation": "shift",
"spec": {
"*": "&",
"debittanceInformation": {
"*": {
"internalDocumentInformation": {
"*": {
"number": "&4_&2_&",
"lineDetails": {
"*": {
"identifications": {
"*": {
"*": {
"#": "&9_&7_&5_&3_&"
},
"model": {
"*": {
"#": "&10_&8_&6_&4_&2\\.&"
}
}
}
},
"quantity": "&6_&4_&2_&",
"unitOfMeasure": "&6_&4_&2_&",
"money": {
"*": {
"#": "&8_&6_&4_&2\\.&"
},
"discountAppliedmoneys": {
"*": {
"model": {
"*": {
"#": "&11_&9_&7_&5\\.&4_&2\\.&"
}
},
"*": "&9_&7_&5_&3\\.&2_&"
}
},
"valuemoneys": {
"*": {
"model": {
"*": {
"#": "&11_&9_&7_&5\\.&4_&2\\.&"
}
},
"*": "&9_&7_&5_&3\\.&2_&"
}
},
"adjustmentmoneyAndReasons": {
"*": {
"*": "&9_&7_&5_&3\\.&2_&"
}
}
}
}
},
"internalDocumentmoney": {
"*": {
"#": "&6_&4_&2\\.&"
},
"discountAppliedmoneys": {
"*": {
"model": {
"*": "&8_&6_&4_&3_&1\\.&"
},
"*": "&7_&5_&3\\.&2_&"
}
},
"valuemoneys": {
"*": {
"model": {
"*": "&8_&6_&4\\.&3_&1\\.&"
},
"*": "&7_&5_&3\\.&2_&"
}
},
"adjustmentmoneyAndReasons": {
"*": {
"*": "&7_&5_&3\\.&2_&"
}
}
}
}
},
"supplierReferenceInformation": {
"model": {
"*": "&4_&2\\.&"
},
"*": "&3_&1\\.&"
},
"bill*": {
"companyIdentifications": {
"*": {
"*": "&5_&3\\.&2_&"
}
},
"*": "&3_&1\\.&"
},
"additionaldebittanceInformation": {
"*": "&3_&1\\[&\\]"
}
}
}
}
}
]
The Java code of flattening JSON records of an indefinite number of levels to a two-dimensional table is extremely long.
You can use SPL, an open-source Java package, to get this done. It is convenient and four lines of code are sufficient:
img
SPL offers JDBC driver to be invoked by Java. Just store the above SPL script as flattenjson.splx and invoke it in Java as you call a stored procedure:
…
Class.forName("com.esproc.jdbc.InternalDriver");
con= DriverManager.getConnection("jdbc:esproc:local://");
st = con.prepareCall("call flattenjson()");
st.execute();
…
Can someone help to get joltspec in required format.
Input request:
{
"data": {
"testDetails": [
{
"contactId": "941",
"contactType": "DM"
},
{
"contactId": "1041",
"contactType": "CM"
}
]
}
}
Expected output:
{
"id": "test_details",
"list": [
{
"id": "contact_type",
"value": "DM,CM"
},
{
"id": "contact_id",
"value": "941,1041"
}
]
}
InputSpec:
[
{
"operation": "shift",
"spec": {
"data": {
"#test_details": "Request.dataset.testDetails.param.[0].id",
"#testDetails": "Request.dataset.testDetails.param.[0].list"
}
}
}
]
If i try like this, I am getting same list as it is in input. I have tried using shift but could not make it to get as id value pair which is expected. Can anyone help on this
You can figure out to combine those comma seperated values through use of modify-overwrite-beta operation, and apply shift for the rest such as
[
{
"operation": "shift",
"spec": {
"data": {
"testDetails": {
"*": {
"*": "&"
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"$": "&.id",
"*": "&1.&"
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"value": "=concat(#(1,0),',',#(1,1))"
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"#(1,&.id)": "&.id",
"#(1,&.value)": "&.value"
}
}
},
{
"operation": "shift",
"spec": {
"#id": "test_details",
"*": "list"
}
}
]
If leaving the camel case instead of the snake case for the ouptut is not a problem, this spec:
[
{
"operation": "shift",
"spec": {
"data": {
"testDetails": {
"*": {
"*": "&.values"
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"$": "&.id",
"*": "&1.&"
}
}
},
{
"operation": "shift",
"spec": {
"*": "list.[#1]",
"#test_details": "id"
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"list": {
"*": {
"values": "=join(',',#(1,values))"
}
}
}
}
]
produces the output like below:
{
"id" : "test_details",
"list" : [ {
"id" : "contactId",
"values" : "941, 1041"
}, {
"id" : "contactType",
"values" : "DM, CM"
} ]
}
Try to examine the output by gradually adding the "shift" operations
Also, have a look at the javadocs of the shift operation and the join function example
edit: if you insist on the snake case, add this shift operation at the beginning of the spec:
{
"operation": "shift",
"spec": {
"data": {
"testDetails": {
"*": {
"contactId": "&3.&2[#2].contact_id",
"contactType": "&3.&2[#2].concact_type"
}
}
}
}
}
Hello everyone my json input is this:
{
"chequesCollateral": [
{
"accountNum": "0026.0002.62.0300162968",
"agreement": "0026.5501.90.0490520505",
"checkno": "229425941 ",
"amount": 20000,
"issueBank": "0026",
"branch": "0154",
"currency": "EUR",
"expDate": "2019-09-20"
},
{
"accountNum": "0026.0002.62.0300162968",
"agreement": "0026.5501.90.0490520505",
"checkno": "322108888 ",
"amount": 2500,
"issueBank": "0011",
"branch": "0335",
"currency": "EUR",
"expDate": "2019-10-26"
},
{
"accountNum": "0026.0002.62.0300162968",
"agreement": "0026.5501.90.0490520505",
"checkno": "321979826 ",
"amount": 3964.77,
"issueBank": "0011",
"branch": "0104",
"currency": "EUR",
"expDate": "2019-10-31"
}
]
}
I use this transform to produce this:
[
{
"operation": "shift",
"spec": {
"chequesCollateral": {
"*": {
"issueBank": "distinctBinData.&0"
}
}
}
}
]
and this is produced:
{
"distinctBinData" : {
"issueBank" : [ "0026", "0011", "0011" ]
}
}
I want to produce this :
{
"distinctBinData" : [ "0026", "0011", "0011" ]
}
What should i do?
You don't have to specify the &0 part in the destination key. &0 refers to the current level JSON key, which is issueBank in your case. So when you specified the destination key as distinctBinData.&0, it resolves to distinctBinData.issueBank. So just use distinctBinData as the destination key as follows.
[
{
"operation": "shift",
"spec": {
"chequesCollateral": {
"*": {
"issueBank": "distinctBinData"
}
}
}
}
]
I have to transform one JSON to another JSON,
I am new to jolt.if you have any other methods in java please let me know.
Input can have many other attributes in a nested manner.
I have to make generic code which can consume all the fields in JSON and transform it into the desired output which I have mentioned.
Input
{
"id": "123456789",
"OrderType": "ABC",
"Abc": [
{
"Name": "Pluto",
"Value": "Charon"
},
{
"Name": "Earth",
"Value": "Moon"
}
]
}
Desired Output
"MyFieldList": [
{
"Footer": "My Footer",
"fieldList": [
{
"label": "id",
"fieldName": "id",
"fieldValue": "123456789",
"editable": false,
"dataType": "STRING"
},
{
"label": "OrderType",
"fieldName": "OrderType",
"fieldValue": "ABC",
"editable": false,
"dataType": "STRING"
},
{
"label": "Pluto",
"fieldName": "Pluto",
"fieldValue": "Charon",
"editable": false,
"dataType": "STRING"
},
{
"label": "Earth",
"fieldName": "Earth",
"fieldValue": "Moon",
"editable": false,
"dataType": "STRING"
}]
}
]
I have tried using this jolt spec but , I cannot figure out the nested part how to flatten it .
{
"operation": "shift",
"spec": {
"*": {
"$": "[#2].fieldName",
"#": "[#2].fieldValue",
"#false": "[#2].editable",
"# ": "[#2].Size",
"#STRING": "[#2].dataType"
}
}
}
The important part is creating a array of arrays, before turning into the fieldList:
[
{
"operation": "shift",
"spec": {
"id": {
"$": "[#1].[#1].fieldName",
"#": "[#1].[#1].fieldValue",
"#false": "[#1].[#1].editable",
"#STRING": "[#1].[#1].dataType"
},
"OrderType": {
"$": "[#2].[#1].fieldName",
"#": "[#2].[#1].fieldValue",
"#false": "[#2].[#1].editable",
"#STRING": "[#2].[#1].dataType"
},
"Abc": {
"*": {
"Name": "[#3].[&1].fieldName",
"Value": "[#3].[&1].fieldValue",
"#false": "[#3].[&1].editable",
"#STRING": "[#3].[&1].dataType"
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": "MyFieldList.fieldList.[]"
}
}
},
{
"operation": "default",
"spec": {
"MyFieldList": {
"Footer": "My Footer"
}
}
}
]
I want a conditional transformation where I need to add a property in output if the value of a specific field in input matches my condition. Below is my input and output required.
Input
{
"attr": [
{
"name": "first",
"validations": [
{
"type": "Required",
"value": true
}
]
},
{
"name": "last",
"validations": [
{
"type": "lenght",
"value": "10"
}
]
},
{
"name": "email",
"validations": [
{
"type": "min",
"value": 10
}
]
}
]
}
Output
{
"out": [
{
"name": "first",
"required": "yes"
},
{
"name": "last"
},
{
"name": "email"
}
]
}
So I am able to get till the condition, but inside condition, & and # are being respective to the input rather than to the output. Can anybody help me out with the transformation? Below is the spec I have written so far.
[
{
"operation": "shift",
"spec": {
"attr": {
"*": {
"name": "out.&1.name",
"validations": {
"*": {
"type": {
"Required": {
"#(2,value)": "out.&1.req"
}
}
}
}
}
}
}
}
]
This spec does the transform.
[
{
"operation": "shift",
"spec": {
"attr": {
"*": {
"name": "out[&1].name",
"validations": {
"*": {
"type": {
"Required": {
"#yes": "out[&5].required"
}
}
}
}
}
}
}
}
]
However, I think you meant to grab the "value" : true that is a sibling of the "Required" : true, rather than have the output be "yes".
If so swap in this bit.
"Required": {
"#(2,value)": "out[&5].required"
}