Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default format assumption seems to be YAML from STDIN, even when piped input is obviously JSON #3

Open
m-dunbar opened this issue Feb 28, 2021 · 2 comments

Comments

@m-dunbar
Copy link

Hi,

This is a great little tool. But, it's auto-identification of input format doesn't appear to work. Even with obvious JSON, it returns:

YAML error: line 2: found unexpected ':'

Also, what's a MIXIN?

@rjeczalik
Copy link
Owner

Hey @m-dunbar! Could you please show me an example input for which it fails?

Please mind that every JSON is a valid YAML since YAML is a superset of JSON. If YAML parser fails for a valid JSON input, it means there's a bug in YAML parser. Maybe upgrading yaml.v1 package to yaml.v3 would fix the issue?

@rjeczalik
Copy link
Owner

Also you can force the input encoding type with -t flag, e.g. refmt -t json - output.hcl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants