From 3089e4551469bdf243abb0cc8665bb436a86b7a1 Mon Sep 17 00:00:00 2001 From: oppofind <836575280@qq.com> Date: Fri, 15 Nov 2019 01:45:49 +0800 Subject: [PATCH] fix json example error for Timestamp filed --- RELEASE.md | 6 ++++++ src/main/java/com/power/doc/builder/SourceBuilder.java | 2 +- src/main/java/com/power/doc/utils/DocClassUtil.java | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index 9248d29..148f4f6 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -119,6 +119,12 @@ 1. fix #I14PT5 header重复渲染到文档 2. fix #I14MV7 不设置dataDictionaries出现空指针错误 3. 增加请求参数枚举字段解析(试用功能) + +#### 版本号:1.7.7 +- 更新日期:待定 +- 更新内容: + 1. 修改timestamp类型字段创建json示例错误bug + \ No newline at end of file diff --git a/src/main/java/com/power/doc/builder/SourceBuilder.java b/src/main/java/com/power/doc/builder/SourceBuilder.java index a2c0fe4..fe38c95 100644 --- a/src/main/java/com/power/doc/builder/SourceBuilder.java +++ b/src/main/java/com/power/doc/builder/SourceBuilder.java @@ -820,7 +820,7 @@ public class SourceBuilder { String subTypeName = field.getType().getFullyQualifiedName(); String fieldGicName = field.getType().getGenericCanonicalName(); data0.append("\"").append(fieldName).append("\":"); - if (DocClassUtil.isPrimitive(typeSimpleName)) { + if (DocClassUtil.isPrimitive(subTypeName)) { CustomRespField customResponseField = responseFieldMap.get(fieldName); if (null != customResponseField) { Object val = customResponseField.getValue(); diff --git a/src/main/java/com/power/doc/utils/DocClassUtil.java b/src/main/java/com/power/doc/utils/DocClassUtil.java index 5015962..df9e5eb 100644 --- a/src/main/java/com/power/doc/utils/DocClassUtil.java +++ b/src/main/java/com/power/doc/utils/DocClassUtil.java @@ -242,6 +242,8 @@ public class DocClassUtil { return "string"; case "localdate": return "string"; + case "timestamp": + return "string"; case "multipartfile": return "file"; default: