-
Notifications
You must be signed in to change notification settings - Fork 22
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
Pretty printing #19
Comments
Yes, its easier to read, the overhead for having it is basically nothing. Having it as an option would lower the cache hit raito so would be worse imo. |
It's not nothing, that json is ~550kb and minified around 380. That makes a difference. But I agree, it is far more readable. Yes, it would make caching worse, but probably not that much... Probably most people (can) use it minified. |
Prettifying is not needed. The bandwidth overhead is not nothing, and having the user do so when prettifying is easy. On Visual Studio Code, it's a single keybind, and on browsers such as Firefox, a prettified view is generated automatically when receiving JSON. |
Chromium-based browsers will pretty print API responses in version 113 No need |
Why pretty printing?
( public static Gson GSON = new GsonBuilder().setPrettyPrinting().create();
I mean this is an api...that gets used by probably bots and not humans. It increases traffic and file sizes (for them, who download it). Also it affects performance.
Has this an intention?
I'd think about an extra parameter like
?pretty=true
that isfalse
by default.The text was updated successfully, but these errors were encountered: