json pretty print for superuser
Opened this issue · 3 comments
markosiilak commented
Is ther a way for using pretty print without changing your RestApi/Router.php file?
Example:
if (wire('roles')->get("name=superuser")) { $beauty = JSON_PRETTY_PRINT; } echo json_encode($return, $beauty);
thomasaull commented
Hmm I don't think so. I could make the relevant method hookable though. Care to create a PR for that? :) On the other hand, what is your use case for echoing pretty printed json? The browsers usually do that on their own, don't they?
markosiilak commented
Thanks, for answer. It's a just a idea.
Im using superuser for api testing and its better if json result for superuser is not in one row :)
thomasaull commented
Do you know if there‘s any downside of using pretty print in general for all API responses?