thomasaull/RestApi

json pretty print for superuser

Opened this issue · 3 comments

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);

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?

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 :)