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

Proposal: Add a "prettify" option to $string() #334

Closed
jhorbulyk opened this issue Jun 5, 2019 · 2 comments
Closed

Proposal: Add a "prettify" option to $string() #334

jhorbulyk opened this issue Jun 5, 2019 · 2 comments

Comments

@jhorbulyk
Copy link
Contributor

If one has an object that they want to render as a string in JSONata, it is possible to produce a JSON representation of that object with the $string() function. However, this function produces a JSON output with minimal whitespaces which can be good for some situations but not good for others. It would be nice if there was a way to render "prettified" JSON (one line per field, indenting based on the field depth) to the output. Perhaps a second boolean argument to $string() called prettify might do the trick.

@jhorbulyk
Copy link
Contributor Author

Simply adding a second argument to $string() isn't as straight forward as I expected since if one uses $string() in a hof, then the hof supplies an int as a second argument.

@andrew-coleman
Copy link
Member

Resolved by #356

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

No branches or pull requests

2 participants