Title: Error when trying to create a map from an array · Issue #139 · IBM/JSONata4Java · GitHub
Open Graph Title: Error when trying to create a map from an array · Issue #139 · IBM/JSONata4Java
X Title: Error when trying to create a map from an array · Issue #139 · IBM/JSONata4Java
Description: The following scenario is not working with 1.5.0 The Data used is : { "result": [ { "title" : "ACT-A", "details" : { "description" : "it is act A description", "date" : "24-02-2021" } }, { "title" : "ACT-B", "details" : { "description" :...
Open Graph Description: The following scenario is not working with 1.5.0 The Data used is : { "result": [ { "title" : "ACT-A", "details" : { "description" : "it is act A description", "date" : "24-02-2021" } }, { "title" ...
X Description: The following scenario is not working with 1.5.0 The Data used is : { "result": [ { "title" : "ACT-A", "details" : { "description" : "it is ac...
Opengraph URL: https://github.com/IBM/JSONata4Java/issues/139
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error when trying to create a map from an array","articleBody":"The following scenario is not working with 1.5.0\r\nThe Data used is :\r\n```json\r\n{\r\n \"result\": [\r\n {\r\n \"title\" : \"ACT-A\",\r\n \"details\" : {\r\n \"description\" : \"it is act A description\",\r\n \"date\" : \"24-02-2021\"\r\n }\r\n },\r\n {\r\n \"title\" : \"ACT-B\",\r\n \"details\" : {\r\n \"description\" : \"it is act B description\",\r\n \"date\" : \"24-02-2021\"\r\n }\r\n }\r\n ]\r\n}\r\n```\r\nBelow are the expressions tried:\r\n\r\n```\r\n(\r\n $constructResult:= function($result)\r\n {\r\n {\r\n $result.title : $result.details\r\n }\r\n };\r\n\r\n {\r\n \"result\" : $merge($map(result, $constructResult))\r\n }\r\n)\r\n```\r\nAnd \r\n```\r\n(\r\n $constructResultMap:= function($result)\r\n {\r\n $result{title: details}\r\n };\r\n\r\n {\r\n \"result\" : $constructResultMap(result)\r\n }\r\n)\r\n```\r\n\r\nExpected result is : \r\n```json\r\n{\r\n \"result\": {\r\n \"ACT-A\": {\r\n \"description\": \"it is act A description\",\r\n \"date\": \"24-02-2021\"\r\n },\r\n \"ACT-B\": {\r\n \"description\": \"it is act B description\",\r\n \"date\": \"24-02-2021\"\r\n }\r\n }\r\n}\r\n```\r\nThis works fine in https://try.jsonata.org/ but when I tried to use the same in Jsonata4Java I am getting the below error\r\n\r\n**no viable alternative at input 'function($result){$result{title'**\r\n\r\nKindly assist.\r\n\r\n","author":{"url":"https://github.com/akshatha45","@type":"Person","name":"akshatha45"},"datePublished":"2021-02-24T14:45:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/139/JSONata4Java/issues/139"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:496af838-1c7c-29a3-b8f3-de6d2a3d573f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C390:48B83:304ACCE:4205934:6A5072FD |
| html-safe-nonce | bd263a76f4f22797e7da1f405710257facb39d659308a192681022ca70b49602 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzkwOjQ4QjgzOjMwNEFDQ0U6NDIwNTkzNDo2QTUwNzJGRCIsInZpc2l0b3JfaWQiOiI0NjkwMDE5NDc2Mjk2NDYzMTAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 00ed4b4316d9ddda7f97047615888442de40d938eef3a0d80da01e7b97a6ea0c |
| hovercard-subject-tag | issue:815546044 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IBM/JSONata4Java/139/issue_layout |
| twitter:image | https://opengraph.githubassets.com/62f5d60605ace3b5409a356dcf53c778ecd798888b7e83d08d5f86e220194227/IBM/JSONata4Java/issues/139 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/62f5d60605ace3b5409a356dcf53c778ecd798888b7e83d08d5f86e220194227/IBM/JSONata4Java/issues/139 |
| og:image:alt | The following scenario is not working with 1.5.0 The Data used is : { "result": [ { "title" : "ACT-A", "details" : { "description" : "it is act A description", "date" : "24-02-2021" } }, { "title" ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | akshatha45 |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/IBM/JSONata4Java git https://github.com/IBM/JSONata4Java.git |
| octolytics-dimension-user_id | 1459110 |
| octolytics-dimension-user_login | IBM |
| octolytics-dimension-repository_id | 169904880 |
| octolytics-dimension-repository_nwo | IBM/JSONata4Java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 169904880 |
| octolytics-dimension-repository_network_root_nwo | IBM/JSONata4Java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width