-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Add indentation to json dump #747
Comments
Why not feed the file to some json-formatter/pretty-printer in the case you need to read it? Something like jq? I understand your patch does not change the API. I just do not see much use in making the indentation internal to crow. |
Dumping in a pretty way is a feature that JSON libraries normally provide. Users also could have fed the body to an external JSON parser tool in case of their need! Crow provides JSON support natively as a feature on top of the web framework. So, I think having the feature of indentation in JSON dump will also lead to a better experience for users as they don't need an external tool (like |
Hi all,
I was trying to save the request body (a
JSON
) to a file.It can be done using
wvalue::dump()
method to return a string and then write the string in a file.But, it's not pretty and the JSON won't be easily readable. So, I think it would be great if we could have an indentation option in
wvalue::dump()
method.Regards.
The text was updated successfully, but these errors were encountered: