模型序列化json排除非空属性缩小模型字符体积

This commit is contained in:
hubin 2024-12-18 13:25:10 +08:00
parent 2dcded2a4f
commit 34a1cc90cb

View File

@ -6,6 +6,7 @@ package com.aizuda.bpm.spring.adaptive;
import com.aizuda.bpm.engine.assist.Assert;
import com.aizuda.bpm.engine.handler.FlowJsonHandler;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -27,6 +28,7 @@ public class FlowJacksonHandler implements FlowJsonHandler {
static {
OBJECT_MAPPER.registerModule(new JavaTimeModule());
OBJECT_MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
OBJECT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
}
@Override