You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I intended this function primarily to help with integration with other software rather than for generating content intended for humans to interact with, and so it's intentionally not customizable. cty functions don't typically have optional arguments, because the model for functions doesn't support that idea, so I think it would be tricky to implement exactly the design you've proposed here even if not for my preference to exclude it.
I see you've also opened an issue in Terraform. The Terraform team might have a different opinion about what use-cases the Terraform language in particular is aiming to meet; if they conclude that such a thing would be in Terraform's scope then I'd suggest for Terraform to include a separate JSON formatting function which takes valid JSON as input and returns pretty-printed but functionally-equivalent JSON as output, which would then result with something like jsonformat(jsonencode(...)) in Terraform language terms (using Terraform/HCL's function syntax).
I don't really want to maintain a formatting function like that within this library because the function package is already pretty large as it is, but applications like Terraform would be able to define their own separate formatting functions if they wish, which could then consume the output of jsonencode or indeed JSON data obtained via other means.
E.g.,
The text was updated successfully, but these errors were encountered: