From ef6524626eb4f26ce845094bfe0e38111466f852 Mon Sep 17 00:00:00 2001 From: walon Date: Sat, 14 Aug 2021 12:51:15 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91cfg=20?= =?UTF-8?q?=E5=AF=BC=E5=87=BAjson=E6=A0=BC=E5=BC=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=97=B6=EF=BC=8Cobject=E7=B1=BB=E5=9E=8B=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=80=BC=E4=B8=BAnull=E7=9A=84=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Luban.Job.Cfg/Source/DataExporters/JsonExportor.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Luban.Job.Cfg/Source/DataExporters/JsonExportor.cs b/src/Luban.Job.Cfg/Source/DataExporters/JsonExportor.cs index ef74be1..857a44e 100644 --- a/src/Luban.Job.Cfg/Source/DataExporters/JsonExportor.cs +++ b/src/Luban.Job.Cfg/Source/DataExporters/JsonExportor.cs @@ -111,14 +111,15 @@ namespace Luban.Job.Cfg.DataExporters continue; } - x.WritePropertyName(defField.Name); // 特殊处理 bean 多态类型 + // 另外,不生成 xxx:null 这样 if (d == null || (d is DBean db && db.ImplType == null)) { - x.WriteNullValue(); + //x.WriteNullValue(); } else { + x.WritePropertyName(defField.Name); d.Apply(this, ass, x); } }