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

jsonencode does not create JSON structure #7028

Closed
rkulagowski opened this issue Jun 6, 2016 · 3 comments
Closed

jsonencode does not create JSON structure #7028

rkulagowski opened this issue Jun 6, 2016 · 3 comments

Comments

@rkulagowski
Copy link
Contributor

Terraform Version

0.6.16

Affected Resource(s)

jsonencode

Expected Behavior

What should have happened?

jsonencode("email:foo@bar.baz, dept:Development")

should have (?) turned into

{"email": "foo@bar.baz","dept": "Development" }

Actual Behavior

What actually happened?

"\"email:foo@bar.baz, dept:Development\""

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

@jen20
Copy link
Contributor

jen20 commented Jun 17, 2016

Hi @rkulagowski! I agree the behaviour here is slightly weird. It's actually unclear to me what should happen when you JSON-encode a string without a key. I think we need to go back to the drawing board with this interpolation function and figure out what the semantics should be and get them documented. Thanks for bringing this to our attention!

cc @phinze.

@jen20 jen20 added the bug label Jun 17, 2016
@mitchellh
Copy link
Contributor

This is working as expected I believe. With first-class map/list support in 0.7 you can now give it a map and get the proper value and other interpolation functions exist to help convert strings to maps.

@ghost
Copy link

ghost commented Apr 20, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants