diff --git a/src/main/java/io/github/lukehutch/fastclasspathscanner/json/JSONMapper.java b/src/main/java/io/github/lukehutch/fastclasspathscanner/json/JSONMapper.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/github/lukehutch/fastclasspathscanner/json/JSONMapper.java
+++ b/src/main/java/io/github/lukehutch/fastclasspathscanner/json/JSONMapper.java
@@ -69,7 +69,7 @@ public class JSONMapper {
      * fields.
      */
     public static String toJSON(final Object obj, final int indentWidth) {
-        return JSONSerializer.toJSON(obj, 0);
+        return JSONSerializer.toJSON(obj, indentWidth);
     }
 
     // -------------------------------------------------------------------------------------------------------------
Pass in indentWidth