From df106b1912e6e28fd9b98f9aa09a00ab35245e16 Mon Sep 17 00:00:00 2001 From: oppofind <836575280@qq.com> Date: Sat, 4 Jan 2020 23:25:57 +0800 Subject: [PATCH] add json format --- .../com/power/doc/template/SpringBootDocBuildTemplate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java b/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java index 324ae3f..9cf6e96 100644 --- a/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java +++ b/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java @@ -220,11 +220,11 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate { .append("\":") .append(DocUtil.handleJsonStr(mockValue)) .append("}"); - requestExample.setJsonBody(builder.toString()).setJson(true); + requestExample.setJsonBody(JsonFormatUtil.formatJson(builder.toString())).setJson(true); paramAdded = true; } else { String json = JsonBuildHelper.buildJson(typeName, gicTypeName, Boolean.FALSE, 0, new HashMap<>(), configBuilder); - requestExample.setJsonBody(json).setJson(true); + requestExample.setJsonBody(JsonFormatUtil.formatJson(json)).setJson(true); paramAdded = true; } } else if (SpringMvcAnnotations.PATH_VARIABLE.contains(annotationName)) {