We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 345edbc commit 553d08cCopy full SHA for 553d08c
apidoc-core/src/main/java/com/ztianzeng/apidoc/utils/Json.java
@@ -4,6 +4,9 @@
4
import com.fasterxml.jackson.databind.ObjectMapper;
5
import com.fasterxml.jackson.databind.ObjectWriter;
6
7
+import java.io.File;
8
+import java.io.IOException;
9
+
10
public class Json {
11
12
private static ObjectMapper mapper;
@@ -35,4 +38,9 @@ public static void prettyPrint(Object o) {
35
38
e.printStackTrace();
36
39
}
37
40
41
42
+ public static void pretty(String filePath, Object o) throws IOException {
43
+ File file = new File(filePath);
44
+ mapper().writeValue(file, o);
45
+ }
46
0 commit comments