{"action":"created","issue":{"url":"https://api.github.com/repos/gokmen/hcl-to-json/issues/1","repository_url":"https://api.github.com/repos/gokmen/hcl-to-json","labels_url":"https://api.github.com/repos/gokmen/hcl-to-json/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/gokmen/hcl-to-json/issues/1/comments","events_url":"https://api.github.com/repos/gokmen/hcl-to-json/issues/1/events","html_url":"https://github.com/gokmen/hcl-to-json/issues/1","id":222871621,"number":1,"title":"Strange result with nested resources","user":{"login":"LinusU","id":189580,"avatar_url":"https://avatars3.githubusercontent.com/u/189580?v=3","gravatar_id":"","url":"https://api.github.com/users/LinusU","html_url":"https://github.com/LinusU","followers_url":"https://api.github.com/users/LinusU/followers","following_url":"https://api.github.com/users/LinusU/following{/other_user}","gists_url":"https://api.github.com/users/LinusU/gists{/gist_id}","starred_url":"https://api.github.com/users/LinusU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LinusU/subscriptions","organizations_url":"https://api.github.com/users/LinusU/orgs","repos_url":"https://api.github.com/users/LinusU/repos","events_url":"https://api.github.com/users/LinusU/events{/privacy}","received_events_url":"https://api.github.com/users/LinusU/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-19T21:06:03Z","updated_at":"2017-04-19T21:34:31Z","closed_at":null,"body":"Given this small example:\r\n\r\n```js\r\n// This example is created to test hcl-to-json on runkit.com\r\nhcltojson = require('hcl-to-json');\r\n\r\nvar hcl_content;\r\n\r\nhcl_content = `\r\ngroup \"test\" {\r\n  task \"a\" {\r\n    name = \"A\"\r\n  }\r\n  \r\n  task \"b\" {\r\n    name = \"B\"\r\n  }\r\n  \r\n  task \"c\" {\r\n    name = \"C\"\r\n  }\r\n}\r\n`\r\n\r\nJSON.stringify(hcltojson(hcl_content), null, 2);\r\n```\r\n\r\nthe following output is generated:\r\n\r\n```json\r\n{\r\n  \"group\": {\r\n    \"test\": {\r\n      \"task\": {\r\n        \"a\": {\r\n          \"name\": \"A\"\r\n        },\r\n        \"task\": {\r\n          \"b\": {\r\n            \"name\": \"B\"\r\n          },\r\n          \"task\": {\r\n            \"c\": {\r\n              \"name\": \"C\"\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nI would expect it to output something like:\r\n\r\n```json\r\n{\r\n  \"group\": {\r\n    \"test\": {\r\n      \"task\": {\r\n        \"a\": {\r\n          \"name\": \"A\"\r\n        },\r\n        \"b\": {\r\n          \"name\": \"B\"\r\n        },\r\n        \"c\": {\r\n          \"name\": \"C\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/gokmen/hcl-to-json/issues/comments/295453540","html_url":"https://github.com/gokmen/hcl-to-json/issues/1#issuecomment-295453540","issue_url":"https://api.github.com/repos/gokmen/hcl-to-json/issues/1","id":295453540,"user":{"login":"gokmen","id":42368,"avatar_url":"https://avatars1.githubusercontent.com/u/42368?v=3","gravatar_id":"","url":"https://api.github.com/users/gokmen","html_url":"https://github.com/gokmen","followers_url":"https://api.github.com/users/gokmen/followers","following_url":"https://api.github.com/users/gokmen/following{/other_user}","gists_url":"https://api.github.com/users/gokmen/gists{/gist_id}","starred_url":"https://api.github.com/users/gokmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gokmen/subscriptions","organizations_url":"https://api.github.com/users/gokmen/orgs","repos_url":"https://api.github.com/users/gokmen/repos","events_url":"https://api.github.com/users/gokmen/events{/privacy}","received_events_url":"https://api.github.com/users/gokmen/received_events","type":"User","site_admin":false},"created_at":"2017-04-19T21:34:31Z","updated_at":"2017-04-19T21:34:31Z","body":"I will take a look at it, I can reproduce the issue as well. Thanks for reporting."}}
{"actor":{"display_login":"gokmen"}}