You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using [] to force a single item to an array also puts sub items into an array. This differs in fuctionality to the JSONata exerciser and thus not giving us the output we expect:
Using [] to force a single item to an array also puts sub items into an array. This differs in fuctionality to the JSONata exerciser and thus not giving us the output we expect:
I simplified our problem:
Jsonata:
$.( { "items": orderItems.{ "itemId": itemId, "quantity": quantity.value, "code": quantity.unit }[] } )
Input:
{ "orderItems": [ { "itemId": "3fa85f64-5717-4562-b3fc-21234f66afa6", "quantity": { "value": 2, "unit": "EA" } }, { "itemId": "3fa85f64-5717-4562-b3fc-21235f66afa6", "quantity": { "value": 2, "unit": "EA" } } ] }
Expected Output:
{ "items": [ { "itemId": "3fa85f64-5717-4562-b3fc-21234f66afa6", "quantity": 2, "code": "EA" }, { "itemId": "3fa85f64-5717-4562-b3fc-21235f66afa6", "quantity": 2, "code": "EA" } ] }
Actual output:
{ "items" : [ { "itemId" : "3fa85f64-5717-4562-b3fc-21234f66afa6", "quantity" : [ 2 ], "code" : [ "EA" ] }, { "itemId" : "3fa85f64-5717-4562-b3fc-21235f66afa6", "quantity" : [ 2 ], "code" : [ "EA" ] } ] }
This is using Camel JSONata which is using 2.4.5 of this library for reference
The text was updated successfully, but these errors were encountered: