Open ebekker opened 7 years ago
Unfortunately, this seems to be a limitation of the underlying parsing library (the official one from Hashicorp). From reading the corresponding source code, it's clear that they only accept objects as the root on purpose (see https://github.com/hashicorp/hcl/blob/master/json/parser/parser.go#L47-L48). However, it may be a good idea to open an issue about that in their repository.
JSON input that starts with a root array is unparsable.
For example, start with input such as the JSON sample from here (the content of
task-definitions/service.json
).You get the following error:
unable to parse HCL: At 1:1: expected: IDENT | STRING | ASSIGN | LBRACE got: LBRACK