hashicorp / hashicorp/hcl

how to convert HCL2 into json?

Open
#627 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
5.8k
Forks
657
Avg merge
20h 36m
Merged PRs (30d)
6

Description

hello!
I used function `unmarshal` to convert HCL into `interface{}`, but I meet the error of "unknown token : data xxx xxx". I think it is the problem of HCL version.
But I can not find the way to convert HCL2 into json. It seems `hcldec` cmd can do the work, but I cannot find the function which can do the same thing.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the hcldec command with the unmarshal function mentioned in the issue, focusing on how HCL2 input is represented and converted. Check whether an existing API provides equivalent JSON conversion; done means documenting the supported approach or clearly identifying the missing capability.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.