Skip to content

Commit

Permalink
config check for pretty print
Browse files Browse the repository at this point in the history
  • Loading branch information
aabssmc committed Jun 28, 2024
1 parent e1fd552 commit 969704f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/lol/aabss/skhttp/objects/Json.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ch.njol.skript.registrations.Classes;
import com.google.gson.*;
import lol.aabss.skhttp.SkHttp;

public class Json {

Expand Down Expand Up @@ -78,7 +79,10 @@ public JsonElement addProperty(String key, Object value){
}

public String toString() {
return gson.toJson(element);
if (SkHttp.instance.getConfig().getBoolean("pretty-print-json", true)) {
return gson.toJson(element);
}
return element.toString();
}

}

0 comments on commit 969704f

Please sign in to comment.